Page MenuHomePhabricator

[alias-server] Handle SIGTERM and SIGINT events for graceful app shutdown
ClosedPublic

Authored by bytesofman on Aug 29 2023, 22:23.

Details

Summary

This should have been handled earlier. Has come to light in optimizing how pendingAliases are handled by the app.

Best way to handle pendingAliases with the database involves using caching...so, might as well just use caching to handle the pendingAliases...but good caching solutions (e.g. redis) need to be started and stopped appropriately by the app. This logic isn't in place yet even though it should be for the server and the db.

Add it in anticipation of adding caching.

Test Plan

npm test

node index.js and then ctrl+c, observe shutdown output
node index.js and then, in a separate terminal, ps a -A | grep node, find pid for node index.js, then kill <pid>, observe same output

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable