-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Limit ldap user count #50171
base: master
Are you sure you want to change the base?
Limit ldap user count #50171
Conversation
… performances Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
…ckend Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
cypress failure is unrelated |
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.
few remarks
|
||
foreach ($this->backends as $backend) { | ||
if ($onlyMappedUsers && $backend instanceof ICountMappedUsersBackend) { | ||
$backendUsers = $backend->countMappedUsers(); |
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.
less relevant, but it could benefit from a limit as well?
*/ | ||
public function countUsers() { |
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.
limit is not being used
if ($this->userPluginManager->implementsActions(Backend::COUNT_USERS)) { | ||
return $this->userPluginManager->countUsers(); | ||
} | ||
|
||
$filter = $this->access->getFilterForUserCount(); | ||
$cacheKey = 'countUsers-' . $filter; | ||
$cacheKey = 'countUsers-' . $filter . '-' . $limit; |
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.
not necessary, the cache is being flushed after configuration changes
Summary
This avoids listing all LDAP users only to check if there are more than 100 for the
updatenotification
application. This speeds up opening admin settings a lot on big instances with LDAP backend.The new user count limit is made so that it can be implemented in other backends if needed, and places calling the user count only to compare against a threshold have been adapted to set a limit.
Checklist