From bf7b214cf164088fb7817bc74d6f06d388e6b66e Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 26 Jul 2018 05:27:27 +0900 Subject: [PATCH] :v: --- src/queue/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) 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)