aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/move-to-object-storage.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers/move-to-object-storage.ts')
-rw-r--r--server/lib/job-queue/handlers/move-to-object-storage.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/move-to-object-storage.ts b/server/lib/job-queue/handlers/move-to-object-storage.ts
index a1530cc57..26752ff37 100644
--- a/server/lib/job-queue/handlers/move-to-object-storage.ts
+++ b/server/lib/job-queue/handlers/move-to-object-storage.ts
@@ -19,17 +19,18 @@ export async function processMoveToObjectStorage (job: Job) {
19 const payload = job.data as MoveObjectStoragePayload 19 const payload = job.data as MoveObjectStoragePayload
20 logger.info('Moving video %s in job %s.', payload.videoUUID, job.id) 20 logger.info('Moving video %s in job %s.', payload.videoUUID, job.id)
21 21
22 const fileMutexReleaser = await VideoPathManager.Instance.lockFiles(payload.videoUUID)
23
22 const video = await VideoModel.loadWithFiles(payload.videoUUID) 24 const video = await VideoModel.loadWithFiles(payload.videoUUID)
23 // No video, maybe deleted? 25 // No video, maybe deleted?
24 if (!video) { 26 if (!video) {
25 logger.info('Can\'t process job %d, video does not exist.', job.id, lTagsBase(payload.videoUUID)) 27 logger.info('Can\'t process job %d, video does not exist.', job.id, lTagsBase(payload.videoUUID))
28 fileMutexReleaser()
26 return undefined 29 return undefined
27 } 30 }
28 31
29 const lTags = lTagsBase(video.uuid, video.url) 32 const lTags = lTagsBase(video.uuid, video.url)
30 33
31 const fileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
32
33 try { 34 try {
34 if (video.VideoFiles) { 35 if (video.VideoFiles) {
35 logger.debug('Moving %d webtorrent files for video %s.', video.VideoFiles.length, video.uuid, lTags) 36 logger.debug('Moving %d webtorrent files for video %s.', video.VideoFiles.length, video.uuid, lTags)