Merge pull request #6259 from betagouv/optim-stat-by-weej
optimise les stats du nb de dossiers termines par semaine
This commit is contained in:
commit
c6b6ba96b1
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ module ProcedureStatsConcern
|
|||
def stats_termines_by_week
|
||||
Rails.cache.fetch("#{cache_key_with_version}/stats_termines_by_week", expires_in: 12.hours) do
|
||||
now = Time.zone.now
|
||||
chart_data = dossiers.joins(:traitements)
|
||||
chart_data = dossiers.includes(:traitements)
|
||||
.state_termine
|
||||
.where(traitements: { processed_at: (now.beginning_of_week - 6.months)..now.end_of_week })
|
||||
|
||||
|
|
Loading…
Reference in a new issue