Skip to content

Commit

Permalink
Only dispatch conversions after all database transactions have been c…
Browse files Browse the repository at this point in the history
…ommitted (#3687)
  • Loading branch information
chrispage1 authored Aug 20, 2024
1 parent 5d17547 commit 4530541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Conversions/FileManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 4530541

Please sign in to comment.