Browse Source

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

Fix #12003
pull/4/head
Eugen Rochko 4 years ago
committed by GitHub
parent
commit
e682d3aa9e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/presenters/instance_presenter.rb

+ 1
- 1
app/presenters/instance_presenter.rb View File

@ -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…
Cancel
Save