mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user