From a6e37eebfbef9aef91e35173ed799afb6c4a288b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 May 2021 09:25:11 +0200 Subject: Fix transcoding job priority New resolution jobs are also important if waiting for transcoding is enabled since we publish the video after the first resolution generation --- server/lib/job-queue/handlers/video-transcoding.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/job-queue/handlers') diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 4ee2b2df2..dbf412fbb 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts @@ -1,7 +1,7 @@ import * as Bull from 'bull' import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' import { JOB_PRIORITY } from '@server/initializers/constants' -import { getJobTranscodingPriorityMalus, publishAndFederateIfNeeded } from '@server/lib/video' +import { getTranscodingJobPriority, publishAndFederateIfNeeded } from '@server/lib/video' import { getVideoFilePath } from '@server/lib/video-paths' import { UserModel } from '@server/models/account/user' import { MUser, MUserId, MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models' @@ -215,7 +215,7 @@ async function createHlsJobIfEnabled (user: MUserId, payload: { if (!payload || CONFIG.TRANSCODING.HLS.ENABLED !== true) return false const jobOptions = { - priority: JOB_PRIORITY.TRANSCODING.NEW_RESOLUTION + await getJobTranscodingPriorityMalus(user) + priority: await getTranscodingJobPriority(user) } const hlsTranscodingPayload: HLSTranscodingPayload = { @@ -272,7 +272,7 @@ async function createLowerResolutionsJobs ( resolutionCreated.push(resolution) const jobOptions = { - priority: JOB_PRIORITY.TRANSCODING.NEW_RESOLUTION + await getJobTranscodingPriorityMalus(user) + priority: await getTranscodingJobPriority(user) } JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }, jobOptions) -- cgit v1.2.3