소스 검색

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

Fix #12003
master^2
Eugen Rochko 4 년 전
committed by GitHub
부모
커밋
e682d3aa9e
No known key found for this signature in database 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


불러오는 중...
취소
저장