diff options
author | Robin Appelman <robin@icewind.nl> | 2024-02-07 14:44:24 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-03-06 10:53:55 +0100 |
commit | 9ea3f4ab8f79ca7e85376e25540b77d3ca56f97c (patch) | |
tree | 461c5ff04834c093c66f3d8dfe0fb1f19b981931 /lib | |
parent | 945d97ded1469da0b93285c1817cf5ff4937f88f (diff) | |
download | nextcloud-server-9ea3f4ab8f79ca7e85376e25540b77d3ca56f97c.tar.gz nextcloud-server-9ea3f4ab8f79ca7e85376e25540b77d3ca56f97c.zip |
perf: use lazy user in UserMountCache for getting user for cached mount
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 27d84e93838..19fc1a2b573 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -28,6 +28,7 @@ */ namespace OC\Files\Config; +use OC\User\LazyUser; use OCP\Cache\CappedMemoryCache; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Diagnostics\IEventLogger; @@ -213,13 +214,10 @@ class UserMountCache implements IUserMountCache { /** * @param array $row * @param (callable(CachedMountInfo): string)|null $pathCallback - * @return CachedMountInfo|null + * @return CachedMountInfo */ - private function dbRowToMountInfo(array $row, ?callable $pathCallback = null): ?ICachedMountInfo { - $user = $this->userManager->get($row['user_id']); - if (is_null($user)) { - return null; - } + private function dbRowToMountInfo(array $row, ?callable $pathCallback = null): ICachedMountInfo { + $user = new LazyUser($row['user_id'], $this->userManager); $mount_id = $row['mount_id']; if (!is_null($mount_id)) { $mount_id = (int)$mount_id; |