Merge pull request #2507 from overleaf/bg-graceful-shutdown

graceful shutdown for batch imports

GitOrigin-RevId: 37178109204868a5991b5d89a5dd3be4fc3b7c73
This commit is contained in:
Brian Gough 2020-01-13 13:13:18 +00:00 committed by Copybot
parent 1af8f0358b
commit d420c1e99b

View file

@ -48,4 +48,10 @@ if (!module.parent) {
}) })
} }
// handle SIGTERM for graceful shutdown in kubernetes
process.on('SIGTERM', function(signal) {
logger.warn({ signal: signal }, 'received signal, shutting down')
Settings.shuttingDown = true
})
module.exports = Server.server module.exports = Server.server