diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-02 13:51:06 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 3a0c2a77b1a6626699514ddaf8135f4397175443 (patch) | |
tree | 60bec7ef8e9cdc008b0a4a56aa403617d036bfab /server/lib/job-queue/job-queue.ts | |
parent | 9a3db678f56eda37d222cf2d2232ae0ef5d533d2 (diff) | |
download | PeerTube-3a0c2a77b1a6626699514ddaf8135f4397175443.tar.gz PeerTube-3a0c2a77b1a6626699514ddaf8135f4397175443.tar.zst PeerTube-3a0c2a77b1a6626699514ddaf8135f4397175443.zip |
Enable external plugins to test the PR
Diffstat (limited to 'server/lib/job-queue/job-queue.ts')
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 21bf0f226..03f6fbea7 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -96,6 +96,7 @@ export type CreateJobArgument = | |||
96 | export type CreateJobOptions = { | 96 | export type CreateJobOptions = { |
97 | delay?: number | 97 | delay?: number |
98 | priority?: number | 98 | priority?: number |
99 | failParentOnFailure?: boolean | ||
99 | } | 100 | } |
100 | 101 | ||
101 | const handlers: { [id in JobType]: (job: Job) => Promise<any> } = { | 102 | const handlers: { [id in JobType]: (job: Job) => Promise<any> } = { |
@@ -363,7 +364,11 @@ class JobQueue { | |||
363 | name: 'job', | 364 | name: 'job', |
364 | data: job.payload, | 365 | data: job.payload, |
365 | queueName: job.type, | 366 | queueName: job.type, |
366 | opts: this.buildJobOptions(job.type as JobType, pick(job, [ 'priority', 'delay' ])) | 367 | opts: { |
368 | failParentOnFailure: true, | ||
369 | |||
370 | ...this.buildJobOptions(job.type as JobType, pick(job, [ 'priority', 'delay', 'failParentOnFailure' ])) | ||
371 | } | ||
367 | } | 372 | } |
368 | } | 373 | } |
369 | 374 | ||