diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-31 12:21:39 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-31 12:21:39 +0100 |
commit | e7817fc1e0877efd59f0442934bbb0ad91fbb20a (patch) | |
tree | 6d0502e8a9c2af5a9d962deb40ad4b2216b84b69 /app/helpers/issuables_helper.rb | |
parent | f35d7d7f6ea04a38da822db902ad24108dfe94a2 (diff) | |
download | gitlab-ce-e7817fc1e0877efd59f0442934bbb0ad91fbb20a.tar.gz |
Remove issuable finder count caching
We're going to cache the total open count separately, and then just perform
these counts on the list. We already do that to get the pagination information,
through Kaminari, and a future change will make Kaminari reuse the query results
from earlier in the request.
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r-- | app/helpers/issuables_helper.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 2a748ce0a75..5d7d33da30a 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -240,16 +240,9 @@ module IssuablesHelper } end - def issuables_count_for_state(issuable_type, state, finder: nil) - finder ||= public_send("#{issuable_type}_finder") # rubocop:disable GitlabSecurity/PublicSend - cache_key = finder.state_counter_cache_key - - @counts ||= {} - @counts[cache_key] ||= Rails.cache.fetch(cache_key, expires_in: 2.minutes) do - finder.count_by_state - end - - @counts[cache_key][state] + def issuables_count_for_state(issuable_type, state) + finder = public_send("#{issuable_type}_finder") # rubocop:disable GitlabSecurity/PublicSend + finder.count_by_state end def close_issuable_url(issuable) |