HomePhabricator

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

Description

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

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

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D14429

Details

Provenance
bytesofmanAuthored on Aug 29 2023, 22:21
bytesofmanPushed on Aug 30 2023, 12:29
Reviewer
Restricted Project
Differential Revision
D14429: [alias-server] Handle SIGTERM and SIGINT events for graceful app shutdown
Parents
rABC6262ec955923: remove unused SERIALIZE_TRANSACTION const
Branches
Unknown
Tags
Unknown