-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: add cache wrapper for can_view_courses filter #299
Conversation
Thanks for the pull request, @Ian2012! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Thanks for these changes @Ian2012! |
45f6298
to
e0af695
Compare
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.
Looks good! I tried memoized_func
locally and it seemed to work as expected so I think this should help cut down on dashboard loading 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.
Seems to do the right thing, I'm not sure about removing the get_courses memo though. I think it would still get called repeatedly for different field names, which is likely to happen a few times in quick succession in a dashboard load. Current cache time for all caches if 5 mins, that seems reasonable enough for getting fresh permissions. Since it was monitoring the access key it would get refreshed on a new login as well. What do you think?
We would have two caches, right? Once for the |
Right, so if the macro got called with "course id" and then again with "course key" theoretically we wouldn't have to hit the LMS twice. |
e0af695
to
a3cda98
Compare
@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
This PR adds a cache wrapper for the
can_view_courses
function. The cache can be configured using the supersetdata_cache
It also removes the caching for the
get_courses
function such that people will get the latest courses at login.