log shutdown messages as warnings

This commit is contained in:
Brian Gough 2020-02-04 11:14:14 +00:00
parent a7ec454ed3
commit 1fc8cc44c3

View file

@ -111,17 +111,17 @@ Error.stackTraceLimit = 10
shutdownCleanly = (signal) -> shutdownCleanly = (signal) ->
connectedClients = io.sockets.clients()?.length connectedClients = io.sockets.clients()?.length
if connectedClients == 0 if connectedClients == 0
logger.log("no clients connected, exiting") logger.warn("no clients connected, exiting")
process.exit() process.exit()
else else
logger.log {connectedClients}, "clients still connected, not shutting down yet" logger.warn {connectedClients}, "clients still connected, not shutting down yet"
setTimeout () -> setTimeout () ->
shutdownCleanly(signal) shutdownCleanly(signal)
, 10000 , 30 * 1000
drainAndShutdown = (signal) -> drainAndShutdown = (signal) ->
if Settings.shutDownInProgress if Settings.shutDownInProgress
logger.log signal: signal, "shutdown already in progress, ignoring signal" logger.warn signal: signal, "shutdown already in progress, ignoring signal"
return return
else else
Settings.shutDownInProgress = true Settings.shutDownInProgress = true