From 14f2b3ad1145595190ec515b3d8b23603d01281c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 30 Jul 2018 18:49:54 +0200 Subject: Graceful job queue shutdown --- server.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server.ts') diff --git a/server.ts b/server.ts index efbfd3c97..0e6f787a6 100644 --- a/server.ts +++ b/server.ts @@ -195,4 +195,10 @@ async function startApplication () { logger.info('Server listening on %s:%d', hostname, port) logger.info('Web server: %s', CONFIG.WEBSERVER.URL) }) + + process.on('exit', () => { + JobQueue.Instance.terminate() + }) + + process.on('SIGINT', () => process.exit(0)) } -- cgit v1.2.3