Add sigint handler

This commit is contained in:
Sky Young 2019-07-10 13:26:47 -06:00
parent 31ee7f6367
commit 74d2fc6771
2 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,10 @@ process.on('unhandledRejection', (err, promise) => {
throw err;
});
process.on('SIGINT', async () => {
await node.close();
});
(async () => {
await node.ensure();
await node.open();

View File

@ -33,6 +33,10 @@ process.on('unhandledRejection', (err, promise) => {
throw err;
});
process.on('SIGINT', async () => {
await node.close();
});
(async () => {
await node.ensure();
await node.open();