From ebcf3329f5b820e0d59e1a54271ef0701f2fc3dc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 Jul 2024 14:38:19 +0200 Subject: [PATCH] More robust transcription error job handler --- server/core/lib/video-captions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/lib/video-captions.ts b/server/core/lib/video-captions.ts index 00ccc2f11..7037119f0 100644 --- a/server/core/lib/video-captions.ts +++ b/server/core/lib/video-captions.ts @@ -123,6 +123,9 @@ export async function generateSubtitle (options: { } finally { if (outputPath) await remove(outputPath) + VideoJobInfoModel.decrease(options.video.uuid, 'pendingTranscription') + .catch(err => logger.error('Cannot decrease pendingTranscription job count', { err, ...lTags(options.video.uuid) })) + inputFileMutexReleaser() } } @@ -135,8 +138,6 @@ export async function onTranscriptionEnded (options: { }) { const { video, language, vttPath, lTags: customLTags = [] } = options - await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscription') - if (!isVideoCaptionLanguageValid(language)) { logger.warn(`Invalid transcription language for video ${video.uuid}`, this.lTags(video.uuid)) return