diff options
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/instance_presenter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index 345a5e5e9..a0f1ebd0a 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -24,8 +24,8 @@ class InstancePresenter Rails.cache.fetch('user_count') { User.confirmed.joins(:account).merge(Account.without_suspended).count } end - def active_user_count(weeks = 4) - Rails.cache.fetch("active_user_count/#{weeks}") { Redis.current.pfcount(*(0...weeks).map { |i| "activity:logins:#{i.weeks.ago.utc.to_date.cweek}" }) } + def active_user_count(num_weeks = 4) + Rails.cache.fetch("active_user_count/#{num_weeks}") { ActivityTracker.new('activity:logins', :unique).sum(num_weeks.weeks.ago) } end def status_count |