[provisioning_api] Optimization for for large installations#17718
Closed
mikaelh wants to merge 1 commit intonextcloud:masterfrom
mikaelh:master
Closed
[provisioning_api] Optimization for for large installations#17718mikaelh wants to merge 1 commit intonextcloud:masterfrom mikaelh:master
mikaelh wants to merge 1 commit intonextcloud:masterfrom
mikaelh:master
Conversation
… where subadmins have access to many of groups (>250) - Current implementation in isUserAccessible() iterates over each group a subadmin is member of - UsersController:editUser() calls isUserAccessible() even if the user is admin This fix reduces API calls to editUser (ex change locale/display name) from >2 minutes (!) to ~3 seconds per call in average. Signed-off-by: Mikael Hammarin <mikael@try2.se>
kesselb
reviewed
Oct 28, 2019
| ->andWhere($qb->expr()->eq('gm.uid', $qb->createNamedParameter($user->getUID()))) | ||
| ->setMaxResults(1) | ||
| ->execute(); | ||
| ; |
Contributor
|
Thanks for your patch 🎉 |
nickvergessen
requested changes
Oct 28, 2019
| } | ||
| return false; | ||
|
|
||
| $qb = $this->dbConn->getQueryBuilder(); |
Member
There was a problem hiding this comment.
This only works with the default groups backend, so this is not possible. But I have another idea in mind to make this faster
Contributor
Author
There was a problem hiding this comment.
This only works with the default groups backend, so this is not possible. But I have another idea in mind to make this faster
Ah you are right. I did not think about that. If you point me in a direction I can look into it?
Member
There was a problem hiding this comment.
Supposedly, fetch the user's groups and check whether there is an overlap.
| $subAdminManager = $this->groupManager->getSubAdmin(); | ||
| if ($subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser) | ||
| || $this->groupManager->isAdmin($currentLoggedInUser->getUID())) { | ||
| if ($this->groupManager->isAdmin($currentLoggedInUser->getUID()) |
Member
There was a problem hiding this comment.
This is a nice turn around 👍
Member
|
What's the state here? |
Member
|
Did a new PR in #20677 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patch to optimize for large installations where subadmins have access to many groups (>250)
This fix reduces API calls to editUser (ex change locale/display name) from >2 minutes (!) to ~3 seconds per call in average in current installation.
Signed-off-by: Mikael Hammarin mikael@try2.se