Skip to content

Commit a958903

Browse files
Vincent Composieuxrande
Vincent Composieux
authored andcommitted
Fix create thumbnail exception to be thrown if no media is found
1 parent 48d4113 commit a958903

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Consumer/CreateThumbnailConsumer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public function process(ConsumerEvent $event)
4949
'id' => $event->getMessage()->getValue('mediaId')
5050
));
5151

52-
// solve race condition between message queue and database transaction
53-
$media->setProviderReference($event->getMessage()->getValue('providerReference'));
54-
5552
if (!$media) {
5653
throw new HandlingException(sprintf('Media not found - id: %s', $event->getMessage()->getValue('mediaId')));
5754
}
5855

56+
// solve race condition between message queue and database transaction
57+
$media->setProviderReference($event->getMessage()->getValue('providerReference'));
58+
5959
try {
6060
$this->getThumbnail($event)->generate($this->pool->getProvider($media->getProviderName()), $media);
6161
} catch (\LogicException $e) {

0 commit comments

Comments
 (0)