Commit b2a1919c authored by Brett Walker's avatar Brett Walker 🔴

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.
parent 9429e8ac
Pipeline #14884752 passed with stages
in 66 minutes and 11 seconds
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment