summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2017-12-07 17:29:43 +0100
committerBrett Walker <bwalker@gitlab.com>2017-12-08 14:20:51 +0100
commitb2a1919c3e9dab3d3757d021216c83a324277db3 (patch)
tree760bde90b0b5664ac5928daa4afd1117f7831ec9
parent9429e8ac60a10436a0469d7d206d3f74a2c966c7 (diff)
downloadgitlab-ce-b2a1919c3e9dab3d3757d021216c83a324277db3.tar.gz
expire todo count calculations to be consistent withbw-todo-count-expiration
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.
-rw-r--r--app/models/user.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index af1c36d9c93..093ff808626 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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