Skip to content

Commit d8ada3d

Browse files
committed
$tenantSegment
1 parent 4669d64 commit d8ada3d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Database/Database.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,14 +3068,6 @@ public function getDocument(string $collection, string $id, array $queries = [],
30683068
$validator = new Authorization(self::PERMISSION_READ);
30693069
$documentSecurity = $collection->getAttribute('documentSecurity', false);
30703070

3071-
/**
3072-
* Cache hash keys
3073-
*/
3074-
$tenantSegment = $this->adapter->getTenant();
3075-
if (isset($this->globalCollections[$collection->getId()])) {
3076-
$tenantSegment = null;
3077-
}
3078-
30793071
[$collectionKey, $documentKey, $hashKey] = $this->getCacheKeys(
30803072
$collection->getId(),
30813073
$id,
@@ -6512,12 +6504,18 @@ public function getCacheKeys(string $collectionId, ?string $documentId = null, a
65126504
$hostname = $this->adapter->getHostname();
65136505
}
65146506

6507+
$tenantSegment = $this->adapter->getTenant();
6508+
6509+
if (isset($this->globalCollections[$collectionId])) {
6510+
$tenantSegment = null;
6511+
}
6512+
65156513
$collectionKey = \sprintf(
65166514
'%s-cache-%s:%s:%s:collection:%s',
65176515
$this->cacheName,
65186516
$hostname ?? '',
65196517
$this->getNamespace(),
6520-
$this->adapter->getTenant(),
6518+
$tenantSegment,
65216519
$collectionId
65226520
);
65236521

0 commit comments

Comments
 (0)