diff --git a/services/real-time/app.coffee b/services/real-time/app.coffee index 56db154f83..5a78588591 100644 --- a/services/real-time/app.coffee +++ b/services/real-time/app.coffee @@ -56,7 +56,7 @@ app.get "/", (req, res, next) -> res.send "real-time-sharelatex is alive" app.get "/status", (req, res, next) -> - if shutDownInProgress + if Settings.shutDownInProgress res.send 503 # Service unavailable else res.send "real-time-sharelatex is alive" @@ -120,17 +120,17 @@ forceDrain = -> DrainManager.startDrain(io, 4) , Settings.forceDrainMsDelay -shutDownInProgress = false +Settings.shutDownInProgress = false if Settings.forceDrainMsDelay? Settings.forceDrainMsDelay = parseInt(Settings.forceDrainMsDelay, 10) logger.log forceDrainMsDelay: Settings.forceDrainMsDelay,"forceDrainMsDelay enabled" for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT'] process.on signal, -> - if shutDownInProgress + if Settings.shutDownInProgress logger.log signal: signal, "shutdown already in progress, ignoring signal" return else - shutDownInProgress = true + Settings.shutDownInProgress = true logger.log signal: signal, "received interrupt, cleaning up" shutdownCleanly(signal) forceDrain()