mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[misc] let proxys observe an upcoming shutdown before starting to drain
Otherwise clients may be routed to the same pod upon reconnecting.
This commit is contained in:
parent
2b1c5bf436
commit
d320c2d5f3
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