5
0
Fork 0
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:
f 2022-04-23 19:37:08 -03:00
parent d8060728be
commit 6b191d2d91

View file

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