mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 18:37:17 +01:00
fix: add set storage id for more cache queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
@@ -199,6 +199,7 @@ class Cache implements ICache {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->selectFileCache()
|
||||
->whereParent($fileId)
|
||||
->whereStorageId($this->getNumericStorageId())
|
||||
->orderBy('name', 'ASC');
|
||||
|
||||
$metadataQuery = $query->selectMetadata();
|
||||
@@ -337,6 +338,7 @@ class Cache implements ICache {
|
||||
|
||||
$query->update('filecache')
|
||||
->whereFileId($id)
|
||||
->whereStorageId($this->getNumericStorageId())
|
||||
->andWhere($query->expr()->orX(...array_map(function ($key, $value) use ($query) {
|
||||
return $query->expr()->orX(
|
||||
$query->expr()->neq($key, $query->createNamedParameter($value)),
|
||||
@@ -512,6 +514,7 @@ class Cache implements ICache {
|
||||
if ($entry instanceof ICacheEntry) {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache')
|
||||
->whereStorageId($this->getNumericStorageId())
|
||||
->whereFileId($entry->getId());
|
||||
$query->execute();
|
||||
|
||||
@@ -583,6 +586,7 @@ class Cache implements ICache {
|
||||
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache')
|
||||
->whereStorageId($this->getNumericStorageId())
|
||||
->whereParentInParameter('parentIds');
|
||||
|
||||
// Sorting before chunking allows the db to find the entries close to each
|
||||
@@ -929,6 +933,7 @@ class Cache implements ICache {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->select('size', 'unencrypted_size')
|
||||
->from('filecache')
|
||||
->whereStorageId($this->getNumericStorageId())
|
||||
->whereParent($id);
|
||||
if ($ignoreUnknown) {
|
||||
$query->andWhere($query->expr()->gte('size', $query->createNamedParameter(0)));
|
||||
|
||||
Reference in New Issue
Block a user