mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Add double interrupt logic to ctl to force exit
This commit is contained in:
1 file changed
+7
-1
+7
-1
@@ -311,12 +311,18 @@ async function startControl() {
|
||||
throw err;
|
||||
}
|
||||
|
||||
let caughtSigInt = false;
|
||||
process.on("SIGINT", () => {
|
||||
if (caughtSigInt) {
|
||||
logger.info("Caught second interrupt signal, forcing disconnect");
|
||||
process.exit(1);
|
||||
}
|
||||
caughtSigInt = true;
|
||||
|
||||
logger.info("Caught interrupt signal, closing connection");
|
||||
control.shutdown().catch(err => {
|
||||
setBlocking(true);
|
||||
logger.error(err.stack);
|
||||
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user