aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-02-07 14:44:24 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-06 10:53:55 +0100
commit9ea3f4ab8f79ca7e85376e25540b77d3ca56f97c (patch)
tree461c5ff04834c093c66f3d8dfe0fb1f19b981931 /lib
parent945d97ded1469da0b93285c1817cf5ff4937f88f (diff)
downloadnextcloud-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.php10
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;