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:
Jakob Ackermann 2020-03-23 12:56:05 +01:00 committed by GitHub
commit 7321e80b1e
2 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -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