mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
chore: add chunked queries on occ sharing:delete-orphan-shares
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
76c9189bad
commit
e0ef795ae8
1 changed files with 7 additions and 2 deletions
|
|
@ -39,8 +39,13 @@ class OrphanHelper {
|
|||
public function deleteShares(array $ids): void {
|
||||
$query = $this->connection->getQueryBuilder();
|
||||
$query->delete('share')
|
||||
->where($query->expr()->in('id', $query->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)));
|
||||
$query->executeStatement();
|
||||
->where($query->expr()->in('id', $query->createParameter('ids')));
|
||||
|
||||
$idsChunks = array_chunk($ids, 500);
|
||||
foreach ($idsChunks as $idsChunk) {
|
||||
$query->setParameter('ids', $idsChunk, IQueryBuilder::PARAM_INT_ARRAY)
|
||||
->executeStatement();
|
||||
}
|
||||
}
|
||||
|
||||
public function fileExists(int $fileId): bool {
|
||||
|
|
|
|||
Loading…
Reference in a new issue