mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use FORCE_DRAIN_MS_DELAY
This commit is contained in:
parent
2418e5db57
commit
05611de15e
2 changed files with 5 additions and 6 deletions
|
@ -96,15 +96,14 @@ shutdownCleanly = (signal) ->
|
|||
, 10000
|
||||
|
||||
forceDrain = ->
|
||||
THREE_HOURS = 60 * 1000 * 60 * 3
|
||||
logger.log {delay_ms:THREE_HOURS}, "starting force drain after timeout"
|
||||
forceDrainMsDelay = parseInt(Settings.forceDrainMsDelay, 10)
|
||||
logger.log {delay_ms:forceDrainMsDelay}, "starting force drain after timeout"
|
||||
setTimeout ()->
|
||||
logger.log "starting drain"
|
||||
DrainManager.startDrain(io, 4)
|
||||
, THREE_HOURS
|
||||
, Settings.forceDrainMsDelay
|
||||
|
||||
|
||||
if Settings.delayExitUntilDrained
|
||||
if Settings.forceDrainMsDelay?
|
||||
logger.log "drainBeforeShutdown enabled"
|
||||
for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT']
|
||||
logger.log signal: signal, "received interrupt, cleaning up"
|
||||
|
|
|
@ -42,4 +42,4 @@ module.exports =
|
|||
|
||||
max_doc_length: 2 * 1024 * 1024 # 2mb
|
||||
|
||||
delayExitUntilDrained: process.env['DELAY_EXIT_UNTIL_DRAINED'] or false
|
||||
forceDrainMsDelay: process.env['FORCE_DRAIN_MS_DELAY'] or false
|
Loading…
Reference in a new issue