Sfoglia il codice sorgente

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

Fix #12003
master^2
Eugen Rochko 4 anni fa
committed by GitHub
parent
commit
e682d3aa9e
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      app/presenters/instance_presenter.rb

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

@@ -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


Caricamento…
Annulla
Salva