Skip to content

Commit

Permalink
Merge pull request #9 from OstlerDev/handle-sigint
Browse files Browse the repository at this point in the history
Handle SIGINT close signal
  • Loading branch information
OstlerDev authored Jul 10, 2019
2 parents c7569ae + 40fa7f5 commit cf52e95
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/node
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions bin/spvnode
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit cf52e95

Please sign in to comment.