mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #16888 from overleaf/jpa-faster-filestore-stop-in-dev
[misc] use a common environment variable for the graceful shutdown delay GitOrigin-RevId: 010e83c62eff7bedac3b10e36e9b4f38d6459a1c
This commit is contained in:
parent
621301618f
commit
fd717dff01
4 changed files with 6 additions and 4 deletions
|
@ -217,7 +217,7 @@ const shutdownCleanly = signal => () => {
|
|||
setTimeout(() => {
|
||||
logger.info({ signal }, 'shutting down')
|
||||
process.exit()
|
||||
}, Settings.delayShutdownMs)
|
||||
}, Settings.gracefulShutdownDelayInMs)
|
||||
}
|
||||
|
||||
const watchForEvent = eventName => {
|
||||
|
|
|
@ -168,5 +168,6 @@ module.exports = {
|
|||
continuousBackgroundFlush: process.env.CONTINUOUS_BACKGROUND_FLUSH === 'true',
|
||||
|
||||
smoothingOffset: process.env.SMOOTHING_OFFSET || 1000, // milliseconds
|
||||
delayShutdownMs: parseInt(process.env.DELAY_SHUTDOWN_MS || '10000', 10),
|
||||
gracefulShutdownDelayInMs:
|
||||
parseInt(process.env.GRACEFUL_SHUTDOWN_DELAY_SECONDS ?? '10', 10) * 1000,
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ function handleShutdownSignal(signal) {
|
|||
setTimeout(() => {
|
||||
logger.info({ signal }, 'shutting down')
|
||||
process.exit()
|
||||
}, settings.delayShutdownMs)
|
||||
}, settings.gracefulShutdownDelayInMs)
|
||||
}
|
||||
|
||||
process.on('SIGTERM', handleShutdownSignal)
|
||||
|
|
|
@ -113,7 +113,8 @@ const settings = {
|
|||
dsn: process.env.SENTRY_DSN,
|
||||
},
|
||||
|
||||
delayShutdownMs: parseInt(process.env.DELAY_SHUTDOWN_MS || '30000', 10),
|
||||
gracefulShutdownDelayInMs:
|
||||
parseInt(process.env.GRACEFUL_SHUTDOWN_DELAY_SECONDS ?? '30', 10) * 1000,
|
||||
}
|
||||
|
||||
// Filestore health check
|
||||
|
|
Loading…
Reference in a new issue