Skip to content

Commit

Permalink
fix(metdata): Correctly handle FilesMetadataNotFoundException on blur…
Browse files Browse the repository at this point in the history
…hash generation

Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
SystemKeeper committed Mar 19, 2024
1 parent 6101abb commit a9399ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use OCP\FilesMetadata\AMetadataEvent;
use OCP\FilesMetadata\Event\MetadataBackgroundEvent;
use OCP\FilesMetadata\Event\MetadataLiveEvent;
use OCP\FilesMetadata\Exceptions\FilesMetadataNotFoundException;
use OCP\IPreview;
use OCP\Lock\LockedException;

Expand Down Expand Up @@ -74,8 +75,12 @@ public function handle(Event $event): void {

$currentEtag = $file->getEtag();
$metadata = $event->getMetadata();
if ($metadata->getEtag('blurhash') === $currentEtag) {
return;

try {
if ($metadata->getEtag('blurhash') === $currentEtag) {
return;
}
} catch (FilesMetadataNotFoundException) {
}

// too heavy to run on the live thread, request a rerun as a background job
Expand Down

0 comments on commit a9399ac

Please sign in to comment.