mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
make shutDownInProgress available via settings
This commit is contained in:
parent
5b54d36b37
commit
53431953fc
1 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ app.get "/", (req, res, next) ->
|
||||||
res.send "real-time-sharelatex is alive"
|
res.send "real-time-sharelatex is alive"
|
||||||
|
|
||||||
app.get "/status", (req, res, next) ->
|
app.get "/status", (req, res, next) ->
|
||||||
if shutDownInProgress
|
if Settings.shutDownInProgress
|
||||||
res.send 503 # Service unavailable
|
res.send 503 # Service unavailable
|
||||||
else
|
else
|
||||||
res.send "real-time-sharelatex is alive"
|
res.send "real-time-sharelatex is alive"
|
||||||
|
@ -120,17 +120,17 @@ forceDrain = ->
|
||||||
DrainManager.startDrain(io, 4)
|
DrainManager.startDrain(io, 4)
|
||||||
, Settings.forceDrainMsDelay
|
, Settings.forceDrainMsDelay
|
||||||
|
|
||||||
shutDownInProgress = false
|
Settings.shutDownInProgress = false
|
||||||
if Settings.forceDrainMsDelay?
|
if Settings.forceDrainMsDelay?
|
||||||
Settings.forceDrainMsDelay = parseInt(Settings.forceDrainMsDelay, 10)
|
Settings.forceDrainMsDelay = parseInt(Settings.forceDrainMsDelay, 10)
|
||||||
logger.log forceDrainMsDelay: Settings.forceDrainMsDelay,"forceDrainMsDelay enabled"
|
logger.log forceDrainMsDelay: Settings.forceDrainMsDelay,"forceDrainMsDelay enabled"
|
||||||
for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT']
|
for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT']
|
||||||
process.on signal, ->
|
process.on signal, ->
|
||||||
if shutDownInProgress
|
if Settings.shutDownInProgress
|
||||||
logger.log signal: signal, "shutdown already in progress, ignoring signal"
|
logger.log signal: signal, "shutdown already in progress, ignoring signal"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
shutDownInProgress = true
|
Settings.shutDownInProgress = true
|
||||||
logger.log signal: signal, "received interrupt, cleaning up"
|
logger.log signal: signal, "received interrupt, cleaning up"
|
||||||
shutdownCleanly(signal)
|
shutdownCleanly(signal)
|
||||||
forceDrain()
|
forceDrain()
|
||||||
|
|
Loading…
Reference in a new issue