diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-09 11:52:41 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-11-09 15:00:21 +0100 |
commit | 221ee1adc916684d4881d2a9c4c01954dcde986e (patch) | |
tree | f456a3f3e1fcc2d8dbd3cc6f0d72a4cb2cbbadc2 /server/lib/job-queue/handlers/video-transcoding.ts | |
parent | 4e29f4fe23b413cc8c55ac0d8373f36bcd60b47a (diff) | |
download | PeerTube-221ee1adc916684d4881d2a9c4c01954dcde986e.tar.gz PeerTube-221ee1adc916684d4881d2a9c4c01954dcde986e.tar.zst PeerTube-221ee1adc916684d4881d2a9c4c01954dcde986e.zip |
Add transcoding fail message in client
Diffstat (limited to 'server/lib/job-queue/handlers/video-transcoding.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index b280a1cc9..0143cd02a 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -2,7 +2,7 @@ import { Job } from 'bull' | |||
2 | import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' | 2 | import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' |
3 | import { addTranscodingJob, getTranscodingJobPriority } from '@server/lib/video' | 3 | import { addTranscodingJob, getTranscodingJobPriority } from '@server/lib/video' |
4 | import { VideoPathManager } from '@server/lib/video-path-manager' | 4 | import { VideoPathManager } from '@server/lib/video-path-manager' |
5 | import { moveToFailedState, moveToNextState } from '@server/lib/video-state' | 5 | import { moveToFailedTranscodingState, moveToNextState } from '@server/lib/video-state' |
6 | import { UserModel } from '@server/models/user/user' | 6 | import { UserModel } from '@server/models/user/user' |
7 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' | 7 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' |
8 | import { MUser, MUserId, MVideo, MVideoFullLight, MVideoWithFile } from '@server/types/models' | 8 | import { MUser, MUserId, MVideo, MVideoFullLight, MVideoWithFile } from '@server/types/models' |
@@ -52,14 +52,15 @@ async function processVideoTranscoding (job: Job) { | |||
52 | const handler = handlers[payload.type] | 52 | const handler = handlers[payload.type] |
53 | 53 | ||
54 | if (!handler) { | 54 | if (!handler) { |
55 | await moveToFailedState(video) | 55 | await moveToFailedTranscodingState(video) |
56 | |||
56 | throw new Error('Cannot find transcoding handler for ' + payload.type) | 57 | throw new Error('Cannot find transcoding handler for ' + payload.type) |
57 | } | 58 | } |
58 | 59 | ||
59 | try { | 60 | try { |
60 | await handler(job, payload, video, user) | 61 | await handler(job, payload, video, user) |
61 | } catch (error) { | 62 | } catch (error) { |
62 | await moveToFailedState(video) | 63 | await moveToFailedTranscodingState(video) |
63 | 64 | ||
64 | throw error | 65 | throw error |
65 | } | 66 | } |