mirror of
https://github.com/nextcloud/server.git
synced 2025-05-03 21:40:31 +00:00
fix: optimize FileUtils::getFilesByUser
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
eb597917f6
commit
c5dc90dde9
1 changed files with 6 additions and 7 deletions
|
@ -46,13 +46,12 @@ class FileUtils {
|
|||
|
||||
$mounts = $this->userMountCache->getMountsForFileId($id);
|
||||
$result = [];
|
||||
foreach ($mounts as $mount) {
|
||||
if (isset($result[$mount->getUser()->getUID()])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$userFolder = $this->rootFolder->getUserFolder($mount->getUser()->getUID());
|
||||
$result[$mount->getUser()->getUID()] = $userFolder->getById($id);
|
||||
foreach ($mounts as $cachedMount) {
|
||||
$mount = $this->rootFolder->getMount($cachedMount->getMountPoint());
|
||||
$cache = $mount->getStorage()->getCache();
|
||||
$cacheEntry = $cache->get($id);
|
||||
$node = $this->rootFolder->getNodeFromCacheEntryAndMount($cacheEntry, $mount);
|
||||
$result[$cachedMount->getUser()->getUID()][] = $node;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue