Merge branch 'bw-todo-count-expiration' into 'master'
Todo count calculations now expired quicker for top bar stats See merge request gitlab-org/gitlab-ce!15794
This commit is contained in:
commit
980df27189
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