Merge pull request #9 from OstlerDev/handle-sigint

Handle SIGINT close signal
This commit is contained in:
Sky Young 2019-07-10 13:32:06 -06:00 committed by GitHub
commit cf52e9575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 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();

View File

@ -1,6 +1,6 @@
{
"name": "fcoin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Flo bike-shed",
"license": "MIT",
"repository": "git://github.com/oipwg/fcoin.git",