diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-11-01 11:29:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 11:29:37 +0100 |
commit | 63d3931e8063e1923c2e79416f426b5f3c896ab1 (patch) | |
tree | 92a3a8e21ce74ea02d8aff581cafc981ac4198cf /lib | |
parent | e1bf5c1cd37f29281ab775795b8af0edbb3fc11f (diff) | |
parent | 34600c78bbda8fa232f474936ccbebbfd97c1209 (diff) | |
download | nextcloud-server-63d3931e8063e1923c2e79416f426b5f3c896ab1.tar.gz nextcloud-server-63d3931e8063e1923c2e79416f426b5f3c896ab1.zip |
Merge pull request #29281 from vijfhoek/master
Diffstat (limited to 'lib')
-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; } |