mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 10:41:41 +00:00
usar la misma optimización para stats
This commit is contained in:
parent
d8060728be
commit
6b191d2d91
1 changed files with 1 additions and 0 deletions
|
@ -41,6 +41,7 @@ class StatCollectionJob < PeriodicJob
|
|||
# @return [NilClass]
|
||||
def rollup(name:, interval_previous:, interval:, operation: :sum)
|
||||
Rollup.where(name: name, interval: interval_previous)
|
||||
.where('time >= ?', beginning_of_interval.try(:"beginning_of_#{interval}"))
|
||||
.where_dimensions(site_id: site.id)
|
||||
.group("dimensions->'site_id'")
|
||||
.rollup(name, interval: interval, update: true) do |rollup|
|
||||
|
|
Loading…
Reference in a new issue