Fix active user count for different number of weeks using same cache (#12025)

Fix #12003
lolsob-rspec
Eugen Rochko 2019-10-01 01:19:24 +02:00 committed by GitHub
parent f77337daaf
commit b006b7914e
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class InstancePresenter
end
def active_user_count(weeks = 4)
Rails.cache.fetch('active_user_count') { Redis.current.pfcount(*(0...weeks).map { |i| "activity:logins:#{i.weeks.ago.utc.to_date.cweek}" }) }
Rails.cache.fetch("active_user_count/#{weeks}") { Redis.current.pfcount(*(0...weeks).map { |i| "activity:logins:#{i.weeks.ago.utc.to_date.cweek}" }) }
end
def status_count