diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-30 18:49:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-30 18:49:54 +0200 |
commit | 14f2b3ad1145595190ec515b3d8b23603d01281c (patch) | |
tree | 568d465d14ea62a6ad58da115cae42fc3d8d2567 /server/lib | |
parent | 8e0fd45e14993793c64e06682a4a05c29068d398 (diff) | |
download | PeerTube-14f2b3ad1145595190ec515b3d8b23603d01281c.tar.gz PeerTube-14f2b3ad1145595190ec515b3d8b23603d01281c.tar.zst PeerTube-14f2b3ad1145595190ec515b3d8b23603d01281c.zip |
Graceful job queue shutdown
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index b018d0e8a..157c57ba9 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -83,6 +83,13 @@ class JobQueue { | |||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | terminate () { | ||
87 | for (const queueName of Object.keys(this.queues)) { | ||
88 | const queue = this.queues[queueName] | ||
89 | queue.close() | ||
90 | } | ||
91 | } | ||
92 | |||
86 | createJob (obj: CreateJobArgument) { | 93 | createJob (obj: CreateJobArgument) { |
87 | const queue = this.queues[obj.type] | 94 | const queue = this.queues[obj.type] |
88 | if (queue === undefined) { | 95 | if (queue === undefined) { |