fix: service stop timeout #159
This commit is contained in:
@@ -126,14 +126,20 @@ const initApp = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register process exit events
|
// Register process exit events
|
||||||
["SIGINT", "SIGTERM", "SIGQUIT", "SIGTRAP", "exit"].forEach((signal) => {
|
["SIGINT", "SIGTERM", "SIGQUIT", "exit"].forEach((signal) => {
|
||||||
process.on(signal, () => {
|
process.on(signal, () => {
|
||||||
|
if (APP.exiting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
process.exitCode = 0;
|
process.exitCode = 0;
|
||||||
APP.exiting = true;
|
APP.exiting = true;
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
powerMonitor.on("shutdown", () => {
|
powerMonitor.on("shutdown", () => {
|
||||||
|
if (APP.exiting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
process.exitCode = 0;
|
process.exitCode = 0;
|
||||||
APP.exiting = true;
|
APP.exiting = true;
|
||||||
app.quit();
|
app.quit();
|
||||||
|
|||||||
Reference in New Issue
Block a user