diff options
Diffstat (limited to 'server/lib/transcoding/shared')
3 files changed, 11 insertions, 4 deletions
diff --git a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts b/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts index f1e9efdcf..576e786d5 100644 --- a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts +++ b/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts | |||
@@ -10,6 +10,7 @@ export abstract class AbstractJobBuilder { | |||
10 | videoFile: MVideoFile | 10 | videoFile: MVideoFile |
11 | isNewVideo: boolean | 11 | isNewVideo: boolean |
12 | user: MUserId | 12 | user: MUserId |
13 | videoFileAlreadyLocked: boolean | ||
13 | }): Promise<any> | 14 | }): Promise<any> |
14 | 15 | ||
15 | abstract createTranscodingJobs (options: { | 16 | abstract createTranscodingJobs (options: { |
diff --git a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts index c09c6b8ce..5a9c93ee5 100644 --- a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts +++ b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts | |||
@@ -27,13 +27,16 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder { | |||
27 | videoFile: MVideoFile | 27 | videoFile: MVideoFile |
28 | isNewVideo: boolean | 28 | isNewVideo: boolean |
29 | user: MUserId | 29 | user: MUserId |
30 | videoFileAlreadyLocked: boolean | ||
30 | }) { | 31 | }) { |
31 | const { video, videoFile, isNewVideo, user } = options | 32 | const { video, videoFile, isNewVideo, user, videoFileAlreadyLocked } = options |
32 | 33 | ||
33 | let mergeOrOptimizePayload: MergeAudioTranscodingPayload | OptimizeTranscodingPayload | 34 | let mergeOrOptimizePayload: MergeAudioTranscodingPayload | OptimizeTranscodingPayload |
34 | let nextTranscodingSequentialJobPayloads: (NewWebTorrentResolutionTranscodingPayload | HLSTranscodingPayload)[][] = [] | 35 | let nextTranscodingSequentialJobPayloads: (NewWebTorrentResolutionTranscodingPayload | HLSTranscodingPayload)[][] = [] |
35 | 36 | ||
36 | const mutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid) | 37 | const mutexReleaser = videoFileAlreadyLocked |
38 | ? () => {} | ||
39 | : await VideoPathManager.Instance.lockFiles(video.uuid) | ||
37 | 40 | ||
38 | try { | 41 | try { |
39 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => { | 42 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => { |
diff --git a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts index c7a63d2e2..274dce21b 100644 --- a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts +++ b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts | |||
@@ -26,10 +26,13 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder { | |||
26 | videoFile: MVideoFile | 26 | videoFile: MVideoFile |
27 | isNewVideo: boolean | 27 | isNewVideo: boolean |
28 | user: MUserId | 28 | user: MUserId |
29 | videoFileAlreadyLocked: boolean | ||
29 | }) { | 30 | }) { |
30 | const { video, videoFile, isNewVideo, user } = options | 31 | const { video, videoFile, isNewVideo, user, videoFileAlreadyLocked } = options |
31 | 32 | ||
32 | const mutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid) | 33 | const mutexReleaser = videoFileAlreadyLocked |
34 | ? () => {} | ||
35 | : await VideoPathManager.Instance.lockFiles(video.uuid) | ||
33 | 36 | ||
34 | try { | 37 | try { |
35 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => { | 38 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => { |