Skip to content

Commit

Permalink
[TASK] JB-1250 Webhook: Speed up file lookups (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeBdyElse authored Dec 12, 2023
1 parent 7fd9ec0 commit e957751
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Controller/CloudinaryWebHookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,14 @@ protected function handleFileRename(string $previousFileIdentifier, string $next
protected function getFile(array $cloudinaryResource): File
{
$fileIdentifier = $this->cloudinaryPathService->computeFileIdentifier($cloudinaryResource);
$fileIdentifierHash = $this->storage->hashFileIdentifier($fileIdentifier);
$tableName = 'sys_file';
$q = $this->getQueryBuilder($tableName);
$fileRecord = $q->select('*')
->from($tableName)
->where(
$q->expr()->eq('storage', $this->storage->getUid()),
$q->expr()->eq('identifier', $q->expr()->literal($fileIdentifier))
$q->expr()->eq('identifier_hash', $q->expr()->literal($fileIdentifierHash))
)
->execute()
->fetchAssociative();
Expand Down

0 comments on commit e957751

Please sign in to comment.