mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
Added TERM signal handler
This commit is contained in:
1 parent
e944364fc2
commit
40bd3edb32
1 file changed
+12
@@ -1966,6 +1966,18 @@ async function startServer(args) {
|
|||||||
logger.info("Caught interrupt signal, shutting down");
|
logger.info("Caught interrupt signal, shutting down");
|
||||||
shutdown();
|
shutdown();
|
||||||
});
|
});
|
||||||
|
let secondSigterm = false;
|
||||||
|
process.on("SIGTERM", () => {
|
||||||
|
if (secondSigterm) {
|
||||||
|
logger.fatal("Caught second termination, terminating immediately");
|
||||||
|
// eslint-disable-next-line no-process-exit
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
secondSigterm = true;
|
||||||
|
logger.info("Caught termination signal, shutting down");
|
||||||
|
shutdown();
|
||||||
|
});
|
||||||
|
|
||||||
// terminal closed
|
// terminal closed
|
||||||
process.on("SIGHUP", () => {
|
process.on("SIGHUP", () => {
|
||||||
|
|||||||
Reference in new issue
Block a user