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
Branch
alias-server-redis
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24891
Build 49370: Build Diffalias-server-tests
Build 49369: arc lint + arc unit