diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-05 09:25:11 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-05 09:32:20 +0200 |
commit | a6e37eebfbef9aef91e35173ed799afb6c4a288b (patch) | |
tree | facc792949953f70453f7c59af5c6fde97d4a45c /server/lib/job-queue | |
parent | 494e60804d15dfe1675d0390c8a7317911fd643f (diff) | |
download | PeerTube-a6e37eebfbef9aef91e35173ed799afb6c4a288b.tar.gz PeerTube-a6e37eebfbef9aef91e35173ed799afb6c4a288b.tar.zst PeerTube-a6e37eebfbef9aef91e35173ed799afb6c4a288b.zip |
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
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ | |||
1 | import * as Bull from 'bull' | 1 | import * as Bull from 'bull' |
2 | import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' | 2 | import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' |
3 | import { JOB_PRIORITY } from '@server/initializers/constants' | 3 | import { JOB_PRIORITY } from '@server/initializers/constants' |
4 | import { getJobTranscodingPriorityMalus, publishAndFederateIfNeeded } from '@server/lib/video' | 4 | import { getTranscodingJobPriority, publishAndFederateIfNeeded } from '@server/lib/video' |
5 | import { getVideoFilePath } from '@server/lib/video-paths' | 5 | import { getVideoFilePath } from '@server/lib/video-paths' |
6 | import { UserModel } from '@server/models/account/user' | 6 | import { UserModel } from '@server/models/account/user' |
7 | import { MUser, MUserId, MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models' | 7 | import { MUser, MUserId, MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models' |
@@ -215,7 +215,7 @@ async function createHlsJobIfEnabled (user: MUserId, payload: { | |||
215 | if (!payload || CONFIG.TRANSCODING.HLS.ENABLED !== true) return false | 215 | if (!payload || CONFIG.TRANSCODING.HLS.ENABLED !== true) return false |
216 | 216 | ||
217 | const jobOptions = { | 217 | const jobOptions = { |
218 | priority: JOB_PRIORITY.TRANSCODING.NEW_RESOLUTION + await getJobTranscodingPriorityMalus(user) | 218 | priority: await getTranscodingJobPriority(user) |
219 | } | 219 | } |
220 | 220 | ||
221 | const hlsTranscodingPayload: HLSTranscodingPayload = { | 221 | const hlsTranscodingPayload: HLSTranscodingPayload = { |
@@ -272,7 +272,7 @@ async function createLowerResolutionsJobs ( | |||
272 | resolutionCreated.push(resolution) | 272 | resolutionCreated.push(resolution) |
273 | 273 | ||
274 | const jobOptions = { | 274 | const jobOptions = { |
275 | priority: JOB_PRIORITY.TRANSCODING.NEW_RESOLUTION + await getJobTranscodingPriorityMalus(user) | 275 | priority: await getTranscodingJobPriority(user) |
276 | } | 276 | } |
277 | 277 | ||
278 | JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }, jobOptions) | 278 | JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }, jobOptions) |