diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-17 14:09:09 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-17 14:09:09 +0000 |
commit | d0db4080260a7ee8b276b825d1624fcc8dca54cb (patch) | |
tree | 65e2f113d8c7e52dfeba57f271d45e536a76c052 /app/models | |
parent | 42814500438bd2d9aea75cfd372ec61da0d7468d (diff) | |
parent | a6c0eb54dc23931aaa6dd5630bee036c62f86ff5 (diff) | |
download | gitlab-ce-d0db4080260a7ee8b276b825d1624fcc8dca54cb.tar.gz |
Merge branch 'counters_cache_invalidation' into 'master'
Invalidate cache for issue and MR counters separately
See merge request !11394
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index c7160a6af14..088a7cb83d5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -930,10 +930,18 @@ class User < ActiveRecord::Base end def invalidate_cache_counts - Rails.cache.delete(['users', id, 'assigned_open_merge_requests_count']) + invalidate_issue_cache_counts + invalidate_merge_request_cache_counts + end + + def invalidate_issue_cache_counts Rails.cache.delete(['users', id, 'assigned_open_issues_count']) end + def invalidate_merge_request_cache_counts + Rails.cache.delete(['users', id, 'assigned_open_merge_requests_count']) + end + def todos_done_count(force: false) Rails.cache.fetch(['users', id, 'todos_done_count'], force: force) do TodosFinder.new(self, state: :done).execute.count |