about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-10-01 01:19:24 +0200
committerGitHub <noreply@github.com>2019-10-01 01:19:24 +0200
commite682d3aa9e9c9219aa06f7ad5a4f1412b5ea2b4a (patch)
tree7743ee49d25b1c03ad833eb0aadd43d10394ee83 /app
parent5c42f47617d311219d06e082e4daa41e671903c8 (diff)
Fix active user count for different number of weeks using same cache (#12025)
Fix #12003
Diffstat (limited to 'app')
-rw-r--r--app/presenters/instance_presenter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb
index c4caeaa8c..c150bf742 100644
--- a/app/presenters/instance_presenter.rb
+++ b/app/presenters/instance_presenter.rb
@@ -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