From f0438d7c8823a7798bfd2ebf922998b56b056033 Mon Sep 17 00:00:00 2001 From: leukipp Date: Tue, 9 Dec 2025 15:49:51 +0100 Subject: [PATCH] fix: service stop timeout #159 --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6dfbb53..e01ec82 100644 --- a/index.js +++ b/index.js @@ -126,14 +126,20 @@ const initApp = async () => { }); // Register process exit events - ["SIGINT", "SIGTERM", "SIGQUIT", "SIGTRAP", "exit"].forEach((signal) => { + ["SIGINT", "SIGTERM", "SIGQUIT", "exit"].forEach((signal) => { process.on(signal, () => { + if (APP.exiting) { + return; + } process.exitCode = 0; APP.exiting = true; app.quit(); }); }); powerMonitor.on("shutdown", () => { + if (APP.exiting) { + return; + } process.exitCode = 0; APP.exiting = true; app.quit();