summaryrefslogtreecommitdiff
path: root/src/queue
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-07-26 05:27:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-07-26 05:27:27 +0900
commitf778696a76e5ce2fdeef514cca1f7d293149b69b (patch)
tree2d3300e31654cf70b78a25b869f7902693a55c0c /src/queue
parentImprove tweet embed (diff)
downloadsharkey-f778696a76e5ce2fdeef514cca1f7d293149b69b.tar.gz
sharkey-f778696a76e5ce2fdeef514cca1f7d293149b69b.tar.bz2
sharkey-f778696a76e5ce2fdeef514cca1f7d293149b69b.zip
:v:
Diffstat (limited to 'src/queue')
-rw-r--r--src/queue/index.ts7
1 files changed, 7 insertions, 0 deletions
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)