diff --git a/src/queue/index.ts b/src/queue/index.ts index 1efd6e54e..53853687d 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -12,6 +12,13 @@ const queue = createQueue({ } }); +process.once('SIGTERM', () => { + queue.shutdown(5000, (err: any) => { + console.log('Kue shutdown: ', err || ''); + process.exit(0); + }); +}); + export function createHttp(data: any) { return queue .create('http', data)