aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-13 14:27:40 +0200
committerChocobozzz <me@florianbigard.com>2018-06-13 14:27:40 +0200
commit90d4bb8125e80c8060416d4d135ddeaf0a622ede (patch)
treeb3b7181329a08ecc930b54fe7b48095c4155393c /server/lib/job-queue/handlers/video-file.ts
parent3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (diff)
downloadPeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.tar.gz
PeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.tar.zst
PeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.zip
Refractor retry transaction function
Diffstat (limited to 'server/lib/job-queue/handlers/video-file.ts')
-rw-r--r--server/lib/job-queue/handlers/video-file.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts
index f5ad076a6..a5c6bf300 100644
--- a/server/lib/job-queue/handlers/video-file.ts
+++ b/server/lib/job-queue/handlers/video-file.ts
@@ -52,19 +52,11 @@ async function processVideoFile (job: kue.Job) {
52 if (payload.resolution) { 52 if (payload.resolution) {
53 await video.transcodeOriginalVideofile(payload.resolution, payload.isPortraitMode) 53 await video.transcodeOriginalVideofile(payload.resolution, payload.isPortraitMode)
54 54
55 const options = { 55 await retryTransactionWrapper(onVideoFileTranscoderOrImportSuccess, video)
56 arguments: [ video ],
57 errorMessage: 'Cannot execute onVideoFileTranscoderOrImportSuccess with many retries.'
58 }
59 await retryTransactionWrapper(onVideoFileTranscoderOrImportSuccess, options)
60 } else { 56 } else {
61 await video.optimizeOriginalVideofile() 57 await video.optimizeOriginalVideofile()
62 58
63 const options = { 59 await retryTransactionWrapper(onVideoFileOptimizerSuccess, video, payload.isNewVideo)
64 arguments: [ video, payload.isNewVideo ],
65 errorMessage: 'Cannot execute onVideoFileOptimizerSuccess with many retries.'
66 }
67 await retryTransactionWrapper(onVideoFileOptimizerSuccess, options)
68 } 60 }
69 61
70 return video 62 return video