mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
refactor: graceful shutdown using process.once()
instead of process.on()
(#2737)
This commit is contained in:
parent
d04153a8e5
commit
9430e9fc0d
1 changed files with 4 additions and 3 deletions
|
@ -150,9 +150,10 @@ export async function initServer(
|
|||
});
|
||||
}
|
||||
|
||||
process.on('SIGINT', handleShutdownGracefully);
|
||||
process.on('SIGTERM', handleShutdownGracefully);
|
||||
process.on('SIGHUP', handleShutdownGracefully);
|
||||
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
||||
// Use once() so that receiving double signals exit the app.
|
||||
process.once(signal, handleShutdownGracefully);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue