Skip to content
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

enh: improve performance of get_user_id #449

Merged
merged 1 commit into from
May 28, 2023

Conversation

mjeanroy
Copy link
Contributor

This PR improves the performance of the get_user_id function by changing how to retrieve a user from a username:

  • The previous implementation used the users endpoint by using the search query, which starts to be slow when you have thousands of users.
  • The new implementation still uses the users endpoint, but it queries the endpoint by specifying the username parameter, a max of 1, and an exact, which is much faster.

@mjeanroy mjeanroy force-pushed the enh/improve-get-user-id branch from e5f6a7a to 4a20609 Compare May 26, 2023 09:53
Copy link
Collaborator

@ryshoooo ryshoooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mjeanroy

Thanks a lot for this change! :) Happy to see this coming in! LGTM

@ryshoooo ryshoooo merged commit 8edbcfd into marcospereirampj:master May 28, 2023
NoDataIsAvailable pushed a commit to NoDataIsAvailable/python-keycloak-extended that referenced this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants