bin: add sigint listener for safer shutdown
This commit is contained in:
parent
2807240f40
commit
c9ea6aae43
3 changed files with 12 additions and 0 deletions
4
bin/node
4
bin/node
|
|
@ -46,6 +46,10 @@ process.on('unhandledRejection', (err, promise) => {
|
|||
throw err;
|
||||
});
|
||||
|
||||
process.on('SIGINT', async () => {
|
||||
await node.close();
|
||||
});
|
||||
|
||||
(async () => {
|
||||
await node.ensure();
|
||||
await node.open();
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ process.on('unhandledRejection', (err, promise) => {
|
|||
throw err;
|
||||
});
|
||||
|
||||
process.on('SIGINT', async () => {
|
||||
await node.close();
|
||||
});
|
||||
|
||||
(async () => {
|
||||
await node.ensure();
|
||||
await node.open();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ process.on('unhandledRejection', (err, promise) => {
|
|||
throw err;
|
||||
});
|
||||
|
||||
process.on('SIGINT', async () => {
|
||||
await node.close();
|
||||
});
|
||||
|
||||
(async () => {
|
||||
await node.ensure();
|
||||
await node.open();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue