diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-29 11:20:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-29 11:20:17 +0100 |
commit | fa7388f087bb0cdfc4ef9fef9968769723f8cedf (patch) | |
tree | 6a83575d1a75af256b67c5db0bda59d0e7605fde /server | |
parent | 735a8705c899a9954161657bceeab035cc712e9a (diff) | |
download | PeerTube-fa7388f087bb0cdfc4ef9fef9968769723f8cedf.tar.gz PeerTube-fa7388f087bb0cdfc4ef9fef9968769723f8cedf.tar.zst PeerTube-fa7388f087bb0cdfc4ef9fef9968769723f8cedf.zip |
Fix transcoding job count inconsistency
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 2d0798e12..0d80eb6c5 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -94,7 +94,7 @@ async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, video: MV | |||
94 | 94 | ||
95 | logger.info('HLS transcoding job for %s ended.', video.uuid, lTags(video.uuid)) | 95 | logger.info('HLS transcoding job for %s ended.', video.uuid, lTags(video.uuid)) |
96 | 96 | ||
97 | await retryTransactionWrapper(onHlsPlaylistGeneration, video, user, payload) | 97 | await onHlsPlaylistGeneration(video, user, payload) |
98 | } | 98 | } |
99 | 99 | ||
100 | async function handleNewWebTorrentResolutionJob ( | 100 | async function handleNewWebTorrentResolutionJob ( |
@@ -109,7 +109,7 @@ async function handleNewWebTorrentResolutionJob ( | |||
109 | 109 | ||
110 | logger.info('WebTorrent transcoding job for %s ended.', video.uuid, lTags(video.uuid)) | 110 | logger.info('WebTorrent transcoding job for %s ended.', video.uuid, lTags(video.uuid)) |
111 | 111 | ||
112 | await retryTransactionWrapper(onNewWebTorrentFileResolution, video, user, payload) | 112 | await onNewWebTorrentFileResolution(video, user, payload) |
113 | } | 113 | } |
114 | 114 | ||
115 | async function handleWebTorrentMergeAudioJob (job: Job, payload: MergeAudioTranscodingPayload, video: MVideoFullLight, user: MUserId) { | 115 | async function handleWebTorrentMergeAudioJob (job: Job, payload: MergeAudioTranscodingPayload, video: MVideoFullLight, user: MUserId) { |
@@ -119,7 +119,7 @@ async function handleWebTorrentMergeAudioJob (job: Job, payload: MergeAudioTrans | |||
119 | 119 | ||
120 | logger.info('Merge audio transcoding job for %s ended.', video.uuid, lTags(video.uuid)) | 120 | logger.info('Merge audio transcoding job for %s ended.', video.uuid, lTags(video.uuid)) |
121 | 121 | ||
122 | await retryTransactionWrapper(onVideoFileOptimizer, video, payload, 'video', user) | 122 | await onVideoFileOptimizer(video, payload, 'video', user) |
123 | } | 123 | } |
124 | 124 | ||
125 | async function handleWebTorrentOptimizeJob (job: Job, payload: OptimizeTranscodingPayload, video: MVideoFullLight, user: MUserId) { | 125 | async function handleWebTorrentOptimizeJob (job: Job, payload: OptimizeTranscodingPayload, video: MVideoFullLight, user: MUserId) { |
@@ -129,7 +129,7 @@ async function handleWebTorrentOptimizeJob (job: Job, payload: OptimizeTranscodi | |||
129 | 129 | ||
130 | logger.info('Optimize transcoding job for %s ended.', video.uuid, lTags(video.uuid)) | 130 | logger.info('Optimize transcoding job for %s ended.', video.uuid, lTags(video.uuid)) |
131 | 131 | ||
132 | await retryTransactionWrapper(onVideoFileOptimizer, video, payload, transcodeType, user) | 132 | await onVideoFileOptimizer(video, payload, transcodeType, user) |
133 | } | 133 | } |
134 | 134 | ||
135 | // --------------------------------------------------------------------------- | 135 | // --------------------------------------------------------------------------- |
@@ -156,7 +156,7 @@ async function onHlsPlaylistGeneration (video: MVideoFullLight, user: MUser, pay | |||
156 | } | 156 | } |
157 | 157 | ||
158 | await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') | 158 | await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') |
159 | await moveToNextState(video, payload.isNewVideo) | 159 | await retryTransactionWrapper(moveToNextState, video, payload.isNewVideo) |
160 | } | 160 | } |
161 | 161 | ||
162 | async function onVideoFileOptimizer ( | 162 | async function onVideoFileOptimizer ( |
@@ -196,7 +196,7 @@ async function onVideoFileOptimizer ( | |||
196 | 196 | ||
197 | // Move to next state if there are no other resolutions to generate | 197 | // Move to next state if there are no other resolutions to generate |
198 | if (!hasHls && !hasNewResolutions) { | 198 | if (!hasHls && !hasNewResolutions) { |
199 | await moveToNextState(videoDatabase, payload.isNewVideo) | 199 | await retryTransactionWrapper(moveToNextState, videoDatabase, payload.isNewVideo) |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
@@ -208,7 +208,7 @@ async function onNewWebTorrentFileResolution ( | |||
208 | await createHlsJobIfEnabled(user, { ...payload, copyCodecs: true, isMaxQuality: false }) | 208 | await createHlsJobIfEnabled(user, { ...payload, copyCodecs: true, isMaxQuality: false }) |
209 | await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') | 209 | await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') |
210 | 210 | ||
211 | await moveToNextState(video, payload.isNewVideo) | 211 | await retryTransactionWrapper(moveToNextState, video, payload.isNewVideo) |
212 | } | 212 | } |
213 | 213 | ||
214 | async function createHlsJobIfEnabled (user: MUserId, payload: { | 214 | async function createHlsJobIfEnabled (user: MUserId, payload: { |