mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
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
This commit is contained in:
parent
494e60804d
commit
a6e37eebfb
4 changed files with 9 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue