Skip to content
Snippets Groups Projects
Unverified Commit e682d3aa authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

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

Fix #12003
parent 5c42f476
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment