From 77d7e851dccf17dcc89e8fcc2db3f655d1e63f95 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Jan 2021 16:57:21 +0100 Subject: Add priority to transcoding jobs (1 = highest priority) 100 for new resolutions 10 for original file optimization Add a malus for transcoding jobs depending on how many uploads the user did in the last 7 days --- server/lib/job-queue/job-queue.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/lib/job-queue/job-queue.ts') diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 5d0b797b0..38b1d6f1f 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts @@ -47,6 +47,7 @@ type CreateJobArgument = type CreateJobOptions = { delay?: number + priority?: number } const handlers: { [id in JobType]: (job: Bull.Job) => Promise } = { @@ -148,6 +149,7 @@ class JobQueue { backoff: { delay: 60 * 1000, type: 'exponential' }, attempts: JOB_ATTEMPTS[obj.type], timeout: JOB_TTL[obj.type], + priority: options.priority, delay: options.delay } -- cgit v1.2.3