John Molakvoæ
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
14 additions and
6 deletions
-
lib/private/Files/Cache/Cache.php
-
lib/private/Files/Cache/CacheQueryBuilder.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(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|