diff options
-rw-r--r-- | lib/Mount/MountProvider.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Mount/MountProvider.php b/lib/Mount/MountProvider.php index fb5a82f8..4aa88c37 100644 --- a/lib/Mount/MountProvider.php +++ b/lib/Mount/MountProvider.php @@ -244,10 +244,15 @@ class MountProvider implements IMountProvider { $query->select('path') ->from('filecache') ->where($query->expr()->eq('storage', $query->createNamedParameter($userHome->getNumericStorageId(), IQueryBuilder::PARAM_INT))) - ->andWhere($query->expr()->in('path_hash', $query->createNamedParameter($pathHashes, IQueryBuilder::PARAM_STR_ARRAY))); + ->andWhere($query->expr()->in('path_hash', $query->createParameter('chunk'))); - $paths = $query->execute()->fetchAll(\PDO::FETCH_COLUMN); - return array_map(function($path) { + $paths = []; + foreach (array_chunk($pathHashes, 1000) as $chunk) { + $query->setParameter('chunk', $chunk, IQueryBuilder::PARAM_STR_ARRAY); + $paths = array_merge($paths, $query->executeQuery()->fetchAll(\PDO::FETCH_COLUMN)); + } + + return array_map(function (string $path): string { return substr($path, 6); // strip leading "files/" }, $paths); } |