From 74d2fc6771c72d7cd928ad9db58576d2298a320f Mon Sep 17 00:00:00 2001 From: Sky Young Date: Wed, 10 Jul 2019 13:26:47 -0600 Subject: [PATCH] Add sigint handler --- bin/node | 4 ++++ bin/spvnode | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bin/node b/bin/node index 48b835e1..d9d1551f 100755 --- a/bin/node +++ b/bin/node @@ -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(); diff --git a/bin/spvnode b/bin/spvnode index 4608468b..b9499c57 100755 --- a/bin/spvnode +++ b/bin/spvnode @@ -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();