From f778696a76e5ce2fdeef514cca1f7d293149b69b Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
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 1efd6e54ef..53853687d7 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)