mirror of
https://github.com/status-im/codimd.git
synced 2025-02-03 17:53:31 +00:00
Handle SIGTERM the same way SIGINT is handled
This commit is contained in:
parent
1473437295
commit
20dc3127b1
8
app.js
8
app.js
@ -626,8 +626,8 @@ process.on('uncaughtException', function (err) {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// gracefully exit
|
||||
process.on('SIGINT', function () {
|
||||
// install exit handler
|
||||
function handleTermSignals() {
|
||||
config.maintenance = true;
|
||||
// disconnect all socket.io clients
|
||||
Object.keys(io.sockets.sockets).forEach(function (key) {
|
||||
@ -649,4 +649,6 @@ process.on('SIGINT', function () {
|
||||
});
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
process.on('SIGINT', handleTermSignals);
|
||||
process.on('SIGTERM', handleTermSignals);
|
||||
|
Loading…
x
Reference in New Issue
Block a user