chore: sort out signal handling (#506)
This commit is contained in:
parent
f31ef598bc
commit
0b74cdaaf8
2 changed files with 15 additions and 2 deletions
|
|
@ -42,7 +42,11 @@ export class Server {
|
|||
}
|
||||
|
||||
setupExitWatchdog() {
|
||||
let isExiting = false;
|
||||
const handleExit = async () => {
|
||||
if (isExiting)
|
||||
return;
|
||||
isExiting = true;
|
||||
setTimeout(() => process.exit(0), 15000);
|
||||
await Promise.all(this._connectionList.map(connection => connection.close()));
|
||||
process.exit(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue