mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 07:38:42 +00:00
Fix active user count for different number of weeks using same cache (#12025)
Fix #12003
This commit is contained in:
parent
5c42f47617
commit
e682d3aa9e
|
@ -21,7 +21,7 @@ class InstancePresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def active_user_count(weeks = 4)
|
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
|
end
|
||||||
|
|
||||||
def status_count
|
def status_count
|
||||||
|
|
Loading…
Reference in a new issue