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

Disable script and course dropdown caches on levelbuilder #16326

Merged
merged 2 commits into from Jul 10, 2017

Conversation

balderdash
Copy link
Contributor

Recently create or deleted scripts don't show up in (or disappear from) the teacher dashboard dropdown because of the cache, which has caused confusion for levelbuilders in the past. I'm guessing we would have the same problem while creating and deleting courses, though that wouldn't come up very often.

We could instead clear the caches when you create or delete a script or course, but I'm not sure how easy it is to muck with pegasus state from dashboard code like that.

@Bjvanminnen
Copy link
Contributor

https://github.com/code-dot-org/code-dot-org/blob/staging/dashboard/app/models/script.rb#L200 Shouldn't we not be caching at all on LB already? (We have the same code for course).

@balderdash
Copy link
Contributor Author

This is for a separate cache that lives under Pegasus's DashboardSection.script_cache, and currently ignores Script.should_cache?.

select(:id, :name).
all.
# Only return courses we've whitelisted in ScriptConstants
select {|course| ScriptConstants.script_in_category?(:full_course, course[:name])}.
map {|course| assignable_info(course)}
@@course_cache[course_cache_key] = courses unless rack_env(:levelbuilder)
courses
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably we could write to the cache regardless (but only read from cache if !levelbuilder) if we wanted to minimize how different things are.

@balderdash balderdash merged commit 049666c into staging Jul 10, 2017
@balderdash balderdash deleted the levelbuilder-dropdown-cache branch July 13, 2017 18:26
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.

None yet

2 participants