expire todo count calculations to be consistent with
assigned_open_merge_requests_count and assigned_open_issues_count, which are used in the top header stats. Also important for a Geo secondary, so that the pending todo stat gets updated on the same frequency as the users open issues/merge requests.
This commit is contained in:
parent
9429e8ac60
commit
b2a1919c3e
1 changed files with 2 additions and 2 deletions
|
@ -1054,13 +1054,13 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def todos_done_count(force: false)
|
||||
Rails.cache.fetch(['users', id, 'todos_done_count'], force: force) do
|
||||
Rails.cache.fetch(['users', id, 'todos_done_count'], force: force, expires_in: 20.minutes) do
|
||||
TodosFinder.new(self, state: :done).execute.count
|
||||
end
|
||||
end
|
||||
|
||||
def todos_pending_count(force: false)
|
||||
Rails.cache.fetch(['users', id, 'todos_pending_count'], force: force) do
|
||||
Rails.cache.fetch(['users', id, 'todos_pending_count'], force: force, expires_in: 20.minutes) do
|
||||
TodosFinder.new(self, state: :pending).execute.count
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue