diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-10-14 20:55:16 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-10-14 21:44:57 +0200 |
commit | 694c073d1f94a54a0ccf19299e06f1de849c6edb (patch) | |
tree | 77e9855f70000396b8a6b793ac8a8dbb61c82783 /app/presenters/instance_presenter.rb | |
parent | ebf2c3195615bb524f6908e84f99887c8775cbc3 (diff) | |
parent | 9b978872cc1a86c7d82afda4060c909dc7ca2536 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/controllers/admin/dashboard_controller.rb`: Upstream completely redesigned the admin dashboard. glitch-soc tracked extra features, but that list is gone. Followed upstram. - `app/views/admin/dashboard/index.html.haml` Upstream completely redesigned the admin dashboard. glitch-soc tracked extra features, but that list is gone. Followed upstram.
Diffstat (limited to 'app/presenters/instance_presenter.rb')
-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 |