mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 06:14:20 -05:00
Handle SIGTERM the same way SIGINT is handled
This commit is contained in:
parent
1473437295
commit
20dc3127b1
1 changed files with 5 additions and 3 deletions
8
app.js
8
app.js
|
@ -626,8 +626,8 @@ process.on('uncaughtException', function (err) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
// gracefully exit
|
// install exit handler
|
||||||
process.on('SIGINT', function () {
|
function handleTermSignals() {
|
||||||
config.maintenance = true;
|
config.maintenance = true;
|
||||||
// disconnect all socket.io clients
|
// disconnect all socket.io clients
|
||||||
Object.keys(io.sockets.sockets).forEach(function (key) {
|
Object.keys(io.sockets.sockets).forEach(function (key) {
|
||||||
|
@ -649,4 +649,6 @@ process.on('SIGINT', function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
}
|
||||||
|
process.on('SIGINT', handleTermSignals);
|
||||||
|
process.on('SIGTERM', handleTermSignals);
|
||||||
|
|
Loading…
Reference in a new issue