diff --git a/app/server/app.js b/app/server/app.js index fda11bb..3e76f38 100644 --- a/app/server/app.js +++ b/app/server/app.js @@ -221,7 +221,8 @@ io.on('connection', function (socket) { }) }) -process.on('SIGINT', function () { +const signals = ['SIGTERM', 'SIGINT'] +signals.forEach(signal => process.on(signal, function () { if (shutdownMode) stop('Safe shutdown aborted, force quitting') else if (connectionCount > 0) { var remainingSeconds = config.safeShutdownDuration @@ -241,7 +242,7 @@ process.on('SIGINT', function () { } }, 1000) } else stop() -}) +})) // clean stop function stop (reason) {