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();