Skip to content

Commit

Permalink
implement withoutoverlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Feb 5, 2024
1 parent ba380de commit 8b6c4c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/Jobs/ConversionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/VideoPosterConversionPresetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
expect($generatedConversion->width)->toBe($width);
}

});
})->only();

0 comments on commit 8b6c4c3

Please sign in to comment.