Skip to content

Commit

Permalink
fix: prevent empty cache entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Feb 13, 2025
1 parent cf9eead commit 5a1e545
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Domain/Repository/RecordRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ public function findByPid(string $table, ?int $pid = null, bool $orderByTstamp =
$result = $query->executeQuery()
->fetchAllAssociative();

$this->cache->set($cacheIdentifier, $result, $this->collectCacheTags($table, $result));
if (!empty($result)) {
$this->cache->set($cacheIdentifier, $result, $this->collectCacheTags($table, $result));
}

return $result;
}

Expand Down

0 comments on commit 5a1e545

Please sign in to comment.