-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Auth._loadRoles should not query the same role twice. #1366
Auth._loadRoles should not query the same role twice. #1366
Conversation
Very cool! |
What happens when new roles are created and added into the hierarchy or removed from the hierarchy? |
Current coverage is
|
Its on a per It is just trying to limit the same query from happening multiple times in the |
Alright! LGTM! |
It would probably be a good idea to sometime in the future cache the results of these |
Caching is quite a challenge in a distributed environment. But we definitely should look into it. |
That being said, the Cache class could support easily role hierarchies, and we could invalidated the same way we invalidate users. If that's something you wanna tackle, feel free to get going. |
This commit actually solves most of our performance problems with Roles in our production environment :) It would be tricky to trigger cache invalidations on multiple VM's when a one VM changes a Role or User. Looking of the invalidation code you have already for the User, you would run into this problem when you have more than one instance of the ParseServer. Do you have anywhere where devs on this project talk (Gitter/IRC/Slack/?), as talking more about this here isnt really ideal. |
Shoot me a mail. |
This fixes bug #1365 By not triggering a
_getAllRoleNamesForId
for roleID's that have already been queried.