Prevent job failure on concurrent HLS transcoding
This commit is contained in:
parent
e2b2c726b1
commit
51335c72cf
|
@ -35,6 +35,7 @@ async function updateStreamingPlaylistsInfohashesIfNeeded () {
|
|||
}
|
||||
|
||||
async function updatePlaylistAfterFileChange (video: MVideo, playlist: MStreamingPlaylist) {
|
||||
try {
|
||||
let playlistWithFiles = await updateMasterHLSPlaylist(video, playlist)
|
||||
playlistWithFiles = await updateSha256VODSegments(video, playlist)
|
||||
|
||||
|
@ -44,6 +45,9 @@ async function updatePlaylistAfterFileChange (video: MVideo, playlist: MStreamin
|
|||
await playlistWithFiles.save()
|
||||
|
||||
video.setHLSPlaylist(playlistWithFiles)
|
||||
} catch (err) {
|
||||
logger.info('Cannot update playlist after file change. Maybe due to concurrent transcoding', { err })
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -42,7 +42,7 @@ const lTags = loggerTagsFactory('transcoding')
|
|||
|
||||
async function processVideoTranscoding (job: Job) {
|
||||
const payload = job.data as VideoTranscodingPayload
|
||||
logger.info('Processing transcoding job %d.', job.id, lTags(payload.videoUUID))
|
||||
logger.info('Processing transcoding job %s.', job.id, lTags(payload.videoUUID))
|
||||
|
||||
const video = await VideoModel.loadFull(payload.videoUUID)
|
||||
// No video, maybe deleted?
|
||||
|
|
|
@ -286,20 +286,16 @@ class JobQueue {
|
|||
async pause () {
|
||||
for (const handlerName of Object.keys(this.workers)) {
|
||||
const worker: Worker = this.workers[handlerName]
|
||||
const queue: Queue = this.queues[handlerName]
|
||||
|
||||
await worker.pause()
|
||||
await queue.pause()
|
||||
}
|
||||
}
|
||||
|
||||
async resume () {
|
||||
resume () {
|
||||
for (const handlerName of Object.keys(this.workers)) {
|
||||
const worker: Worker = this.workers[handlerName]
|
||||
const queue: Queue = this.queues[handlerName]
|
||||
|
||||
worker.resume()
|
||||
await queue.resume()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user