From 7e988d0f464c988336329caf39da281a29fbf260 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Mon, 20 Jan 2025 12:07:35 +0100 Subject: [PATCH 1/2] Add deleteWhenMissingModels to job --- app/Jobs/CloneImageThumbnails.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Jobs/CloneImageThumbnails.php b/app/Jobs/CloneImageThumbnails.php index 9ba028484..c73401ec5 100644 --- a/app/Jobs/CloneImageThumbnails.php +++ b/app/Jobs/CloneImageThumbnails.php @@ -26,10 +26,19 @@ class CloneImageThumbnails extends Job implements ShouldQueue /** * Cloned image of cloned volume + * * @var Image */ public $image; + /** + * Ignore this job if the image does not exist any more. + * + * @var bool + */ + protected $deleteWhenMissingModels = true; + + public function __construct(Image $img, String $prefix) { $this->image = $img; From 7d3a0b93f78557e7335038f176a2469dac27f8f4 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Mon, 20 Jan 2025 12:09:56 +0100 Subject: [PATCH 2/2] Fix CS --- app/Jobs/CloneImageThumbnails.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Jobs/CloneImageThumbnails.php b/app/Jobs/CloneImageThumbnails.php index c73401ec5..a227b06f1 100644 --- a/app/Jobs/CloneImageThumbnails.php +++ b/app/Jobs/CloneImageThumbnails.php @@ -38,7 +38,6 @@ class CloneImageThumbnails extends Job implements ShouldQueue */ protected $deleteWhenMissingModels = true; - public function __construct(Image $img, String $prefix) { $this->image = $img;