ソースを参照

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

Fix #12003
master^2
Eugen Rochko 4年前
committed by GitHub
コミット
e682d3aa9e
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      app/presenters/instance_presenter.rb

+ 1
- 1
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


読み込み中…
キャンセル
保存