From 8b6c4c30143f2e318a477fe83f0a6a78b1d14781 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Mon, 5 Feb 2024 01:27:12 +0100 Subject: [PATCH] implement withoutoverlapping --- src/Jobs/ConversionJob.php | 8 +++++++- tests/Feature/VideoPosterConversionPresetTest.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Jobs/ConversionJob.php b/src/Jobs/ConversionJob.php index 873c42a..4eece1a 100644 --- a/src/Jobs/ConversionJob.php +++ b/src/Jobs/ConversionJob.php @@ -33,8 +33,14 @@ public function uniqueId() public function middleware(): array { + if ($this->job?->getConnectionName() === 'sync') { + return []; + } + return [ - (new WithoutOverlapping("media:{$this->media->id}"))->shared()->expireAfter(now()->addMinutes(60)), + (new WithoutOverlapping("media:{$this->media->id}")) + ->shared() + ->expireAfter(now()->addMinutes(60)), ]; } diff --git a/tests/Feature/VideoPosterConversionPresetTest.php b/tests/Feature/VideoPosterConversionPresetTest.php index bdb15f7..9287ddb 100644 --- a/tests/Feature/VideoPosterConversionPresetTest.php +++ b/tests/Feature/VideoPosterConversionPresetTest.php @@ -37,4 +37,4 @@ expect($generatedConversion->width)->toBe($width); } -}); +})->only();