From 453054178128b4e12e902651fe8f2afe37a5ba34 Mon Sep 17 00:00:00 2001 From: Chris Page Date: Tue, 20 Aug 2024 10:30:53 +0100 Subject: [PATCH] Only dispatch conversions after all database transactions have been committed (#3687) --- src/Conversions/FileManipulator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Conversions/FileManipulator.php b/src/Conversions/FileManipulator.php index 9a068085d..b80d513c4 100644 --- a/src/Conversions/FileManipulator.php +++ b/src/Conversions/FileManipulator.php @@ -95,7 +95,7 @@ protected function dispatchQueuedConversions( ->onConnection(config('media-library.queue_connection_name')) ->onQueue(config('media-library.queue_name')); - dispatch($job); + dispatch($job)->afterCommit(); return $this; } @@ -120,7 +120,7 @@ protected function generateResponsiveImages(Media $media, bool $withResponsiveIm ->onConnection(config('media-library.queue_connection_name')) ->onQueue(config('media-library.queue_name')); - dispatch($job); + dispatch($job)->afterCommit(); return $this; }