mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #119 from overleaf/jpa-delay-shutdown
[misc] let proxys observe an upcoming shutdown before starting to drain
This commit is contained in:
commit
7321e80b1e
2 changed files with 10 additions and 3 deletions
|
@ -125,9 +125,14 @@ drainAndShutdown = (signal) ->
|
|||
return
|
||||
else
|
||||
Settings.shutDownInProgress = true
|
||||
logger.warn signal: signal, "received interrupt, starting drain over #{shutdownDrainTimeWindow} mins"
|
||||
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
|
||||
shutdownCleanly(signal)
|
||||
statusCheckInterval = Settings.statusCheckInterval
|
||||
if statusCheckInterval
|
||||
logger.warn signal: signal, "received interrupt, delay drain by #{statusCheckInterval}ms"
|
||||
setTimeout () ->
|
||||
logger.warn signal: signal, "received interrupt, starting drain over #{shutdownDrainTimeWindow} mins"
|
||||
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
|
||||
shutdownCleanly(signal)
|
||||
, statusCheckInterval
|
||||
|
||||
|
||||
Settings.shutDownInProgress = false
|
||||
|
|
|
@ -60,6 +60,8 @@ settings =
|
|||
|
||||
publishOnIndividualChannels: process.env['PUBLISH_ON_INDIVIDUAL_CHANNELS'] or false
|
||||
|
||||
statusCheckInterval: parseInt(process.env['STATUS_CHECK_INTERVAL'] or '0')
|
||||
|
||||
sentry:
|
||||
dsn: process.env.SENTRY_DSN
|
||||
|
||||
|
|
Loading…
Reference in a new issue