Skip to content

Commit

Permalink
Merge pull request #21 from square/catch-another
Browse files Browse the repository at this point in the history
More graceful fallback handling
  • Loading branch information
bezhermoso authored Jan 18, 2023
2 parents 31d75ed + 60c781d commit 0750f3a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Store/TaggedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,19 @@ public function getMultiple(array $keys) : StoreResult
unset($r[$k]);
continue;
}
$allTags = array_merge($allTags, array_keys($tv->tags));
$allTags[] = array_keys($tv->tags);
}
$allTags = array_merge(...$allTags);

$allCurrentTagHashes = [];
if (!empty($allTags)) {
$allCurrentTagHashes = $this->cache->getMultiple($allTags);
if ($allCurrentTagHashes instanceof Iterator) {
$allCurrentTagHashes = iterator_to_array($allCurrentTagHashes);
try {
$allCurrentTagHashes = $this->cache->getMultiple($allTags);
if ($allCurrentTagHashes instanceof Iterator) {
$allCurrentTagHashes = iterator_to_array($allCurrentTagHashes);
}
} catch (CacheException | SimpleCacheCacheException $e) {
return new StoreResult([], $e);
}
}

Expand Down

0 comments on commit 0750f3a

Please sign in to comment.