diff options
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 16 | ||||
-rw-r--r-- | lib/private/Files/Cache/CacheQueryBuilder.php | 4 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 443a2b554a0..dc2ba78457e 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -589,8 +589,12 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->delete('filecache_extended') - ->where($query->expr()->in('fileid', $query->createNamedParameter($childIds, IQueryBuilder::PARAM_INT_ARRAY))); - $query->execute(); + ->where($query->expr()->in('fileid', $query->createParameter('childIds'))); + + foreach (array_chunk($childIds, 1000) as $childIdChunk) { + $query->setParameter('childIds', $childIdChunk, IQueryBuilder::PARAM_INT_ARRAY); + $query->execute(); + } /** @var ICacheEntry[] $childFolders */ $childFolders = array_filter($children, function ($child) { @@ -604,8 +608,12 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->delete('filecache') - ->whereParentIn($parentIds); - $query->execute(); + ->whereParentInParameter('parentIds'); + + foreach (array_chunk($parentIds, 1000) as $parentIdChunk) { + $query->setParameter('parentIds', $parentIdChunk, IQueryBuilder::PARAM_INT_ARRAY); + $query->execute(); + } } /** diff --git a/lib/private/Files/Cache/CacheQueryBuilder.php b/lib/private/Files/Cache/CacheQueryBuilder.php index 774691ebc31..87a1f940f20 100644 --- a/lib/private/Files/Cache/CacheQueryBuilder.php +++ b/lib/private/Files/Cache/CacheQueryBuilder.php @@ -91,7 +91,7 @@ class CacheQueryBuilder extends QueryBuilder { return $this; } - public function whereParentIn(array $parents) { + public function whereParentInParameter(string $parameter) { $alias = $this->alias; if ($alias) { $alias .= '.'; @@ -99,7 +99,7 @@ class CacheQueryBuilder extends QueryBuilder { $alias = ''; } - $this->andWhere($this->expr()->in("{$alias}parent", $this->createNamedParameter($parents, IQueryBuilder::PARAM_INT_ARRAY))); + $this->andWhere($this->expr()->in("{$alias}parent", $this->createParameter($parameter))); return $this; } |