mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
Limit parameter count per query in Cache.removeChildren
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
This commit is contained in:
parent
9a809df960
commit
c959bf2b42
1 changed files with 14 additions and 8 deletions
|
|
@ -587,10 +587,13 @@ class Cache implements ICache {
|
|||
return $cacheEntry->getId();
|
||||
}, $children);
|
||||
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache_extended')
|
||||
->where($query->expr()->in('fileid', $query->createNamedParameter($childIds, IQueryBuilder::PARAM_INT_ARRAY)));
|
||||
$query->execute();
|
||||
$childIdChunks = array_chunk($childIds, 2048);
|
||||
foreach ($childIdChunks as $childIdChunk) {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache_extended')
|
||||
->where($query->expr()->in('fileid', $query->createNamedParameter($childIdChunk, IQueryBuilder::PARAM_INT_ARRAY)));
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
/** @var ICacheEntry[] $childFolders */
|
||||
$childFolders = array_filter($children, function ($child) {
|
||||
|
|
@ -602,10 +605,13 @@ class Cache implements ICache {
|
|||
}
|
||||
}
|
||||
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache')
|
||||
->whereParentIn($parentIds);
|
||||
$query->execute();
|
||||
$parentIdChunks = array_chunk($parentIds, 2048);
|
||||
foreach ($parentIdChunks as $parentIdChunk) {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache')
|
||||
->whereParentIn($parentIdChunk);
|
||||
$query->execute();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue