-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use lazy user in UserMountCache for getting user for cached mount instead of duplicating logic #43437
Conversation
0d967eb
to
5125c00
Compare
5125c00
to
3ca220d
Compare
3ca220d
to
d3a7d6a
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
This reverts commit 1e2cf82. Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
d3a7d6a
to
51019fd
Compare
return null; | ||
} | ||
private function dbRowToMountInfo(array $row, ?callable $pathCallback = null): ICachedMountInfo { | ||
$user = new LazyUser($row['user_id'], $this->userManager); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment explaining the hack?
This is to prevent fetching the full user multiple times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetching multiple times is not the issue (it's cached), it not having to fetch the user details when nobody is asking for it.
It's the same as with any other use of LazyUser
so a comment would be redundant imo
remove some duplication and hopefully make it clearer what the logic is doing
soft requires only get the path for the users cached mount info when we use it #43426 as they change the same type signature
reverts Filter mounts for file id before trying to get user information #26593 and uses
LazyUser
instead to achieve the same optimization