Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -8214,12 +8214,16 @@ public function purgeCachedCollection(string $collectionId): bool
{
[$collectionKey] = $this->getCacheKeys($collectionId);

$documentKeys = $this->cache->list($collectionKey);
foreach ($documentKeys as $documentKey) {
$this->cache->purge($documentKey);
}
try {
$documentKeys = $this->cache->list($collectionKey);
foreach ($documentKeys as $documentKey) {
$this->cache->purge($documentKey);
}

$this->cache->purge($collectionKey);
$this->cache->purge($collectionKey);
} catch (Exception $e) {
Console::warning('Failed to purge collection from cache: ' . $e->getMessage());
}

return true;
}
Expand All @@ -8241,8 +8245,12 @@ protected function purgeCachedDocumentInternal(string $collectionId, ?string $id

[$collectionKey, $documentKey] = $this->getCacheKeys($collectionId, $id);

$this->cache->purge($collectionKey, $documentKey);
$this->cache->purge($documentKey);
try {
$this->cache->purge($collectionKey, $documentKey);
$this->cache->purge($documentKey);
} catch (Exception $e) {
Console::warning('Failed to purge document from cache: ' . $e->getMessage());
}

return true;
}
Expand Down
Loading