Make "safeShutdownDuration" configurable

Defaults to 300s = 5min
This commit is contained in:
Edgar Onghena 2020-03-18 19:25:48 +01:00
parent eb7d91ffbc
commit 61f19ae3ce

View file

@ -83,7 +83,8 @@ let config = {
server: false server: false
}, },
accesslog: false, accesslog: false,
verify: false verify: false,
safeShutdownDuration: 300
} }
// test if config.json exists, if not provide error message but try to run // test if config.json exists, if not provide error message but try to run
@ -217,7 +218,7 @@ io.on('connection', function (socket) {
process.on('SIGINT', function () { process.on('SIGINT', function () {
if (shutdownMode) stop('Safe shutdown aborted, force quitting') if (shutdownMode) stop('Safe shutdown aborted, force quitting')
else if (connectionCount > 0) { else if (connectionCount > 0) {
var remainingSeconds = 300 var remainingSeconds = config.safeShutdownDuration
shutdownMode = true shutdownMode = true
var message = (connectionCount === 1) ? ' client is still connected' var message = (connectionCount === 1) ? ' client is still connected'