AO3 4581 cache the counts in the wrangling sidebar. #2472
| +end | ||
| + | ||
| +When(/^I flush the wrangling sidebar caches$/) do | ||
| + [Fandom, Character, Relationship, Freeform].each do |klass| |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
| @@ -38,7 +38,9 @@ def show | ||
| @fandoms = @wrangler.fandoms.by_name | ||
| @counts = {} | ||
| [Fandom, Character, Relationship, Freeform].each do |klass| | ||
| - @counts[klass.to_s.downcase.pluralize.to_sym] = klass.unwrangled.in_use.count | ||
| + @counts[klass.to_s.downcase.pluralize.to_sym] = Rails.cache.fetch("/wrangler/counts/sidebar/#{klass.to_s}", race_condition_ttl: 10, expires_in: 1.hour) do |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
Question for clarification: is this the kind of cache that only expires when the expiration time kicks in? So, in this case, the cached count will only expire every hour for each category?
That is correct it will only expire after an hour, The tag wrangling chairs were happy to accept two hours and willing to accept 12 hours.
If @LadyOscar has pre-emptively given her
2 checks passed
| +end | ||
| + | ||
| +When(/^I flush the wrangling sidebar caches$/) do |
|
This issue appears to be broken on test. When you submit a fix for it, can you please move this step definition into the proper file? Right now it's in the tag set steps, but it's not related to tag sets -- it should be in https://github.com/otwcode/otwarchive/blob/master/features/step_definitions/tag_steps.rb, which is where wrangling stuff lives. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
https://otwarchive.atlassian.net/browse/AO3-4581