From 1898918258dedab63779d4d491a9f99e5d179d84 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Mon, 18 Nov 2024 19:13:44 +0900 Subject: [PATCH 1/2] fix: daily_stattistic generator condition (#2288) Signed-off-by: Miles Zhang --- app/workers/charts/daily_statistic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/charts/daily_statistic.rb b/app/workers/charts/daily_statistic.rb index d6010e453..3689e04d1 100644 --- a/app/workers/charts/daily_statistic.rb +++ b/app/workers/charts/daily_statistic.rb @@ -9,7 +9,7 @@ def perform(datetime = nil) datetime ||= 1.day.ago.beginning_of_day last_record = ::DailyStatistic.order(created_at_unixtimestamp: :desc).first start_time = Time.zone.at(last_record ? last_record.created_at_unixtimestamp : Block.find_by(number: 0).timestamp / 1000) - while start_time < datetime + while start_time <= datetime start_time += 1.day ActiveRecord::Base.connection.execute("SET statement_timeout = 0") Charts::DailyStatisticGenerator.new(start_time).call From 757cb72e9c102ee3758ba8d59b5b8efcbe7d18a9 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Tue, 19 Nov 2024 10:52:41 +0900 Subject: [PATCH 2/2] Revert "fix: daily_stattistic generator condition" (#2290) Revert "fix: daily_stattistic generator condition (#2288)" This reverts commit 1898918258dedab63779d4d491a9f99e5d179d84. --- app/workers/charts/daily_statistic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/charts/daily_statistic.rb b/app/workers/charts/daily_statistic.rb index 3689e04d1..d6010e453 100644 --- a/app/workers/charts/daily_statistic.rb +++ b/app/workers/charts/daily_statistic.rb @@ -9,7 +9,7 @@ def perform(datetime = nil) datetime ||= 1.day.ago.beginning_of_day last_record = ::DailyStatistic.order(created_at_unixtimestamp: :desc).first start_time = Time.zone.at(last_record ? last_record.created_at_unixtimestamp : Block.find_by(number: 0).timestamp / 1000) - while start_time <= datetime + while start_time < datetime start_time += 1.day ActiveRecord::Base.connection.execute("SET statement_timeout = 0") Charts::DailyStatisticGenerator.new(start_time).call