use delayExitUntilDrained

This commit is contained in:
Henry Oswald 2018-12-04 14:21:05 +00:00
parent 8073cdea75
commit 2418e5db57
2 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,5 @@
Metrics = require("metrics-sharelatex")
Settings = require "settings-sharelatex"
Metrics.initialize(Settings.appName or "real-time")
logger = require "logger-sharelatex"
@ -8,7 +9,6 @@ Metrics.event_loop.monitor(logger)
express = require("express")
session = require("express-session")
redis = require("redis-sharelatex")
Settings = require "settings-sharelatex"
if Settings.sentry?.dsn?
logger.initializeErrorReporting(Settings.sentry.dsn)
@ -104,7 +104,7 @@ forceDrain = ->
, THREE_HOURS
if Settings.drainBeforeShutdown
if Settings.delayExitUntilDrained
logger.log "drainBeforeShutdown enabled"
for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT']
logger.log signal: signal, "received interrupt, cleaning up"

View file

@ -42,4 +42,4 @@ module.exports =
max_doc_length: 2 * 1024 * 1024 # 2mb
drainBeforeShutdown: process.env['DRAIN_BEFORE_SHUTDOWN'] or false
delayExitUntilDrained: process.env['DELAY_EXIT_UNTIL_DRAINED'] or false