From e9653c13eb3639a1eaa36e3c161bf212ef216962 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:37:50 +0100 Subject: [PATCH] Add double interrupt logic to ctl to force exit --- packages/ctl/ctl.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/ctl/ctl.ts b/packages/ctl/ctl.ts index d230cabe..ffcc55fc 100755 --- a/packages/ctl/ctl.ts +++ b/packages/ctl/ctl.ts @@ -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); }); });