Skip to content

Commit 1df66a0

Browse files
committed
remove default order from pruning cutoff date calc
1 parent e779680 commit 1df66a0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/workers/prune_event_logs_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def perform(ts = Time.current.iso8601)
4646

4747
@hi_vol_event_type_ids = EventType.where(event: HIGH_VOLUME_EVENTS).ids
4848
@cutoff_end_date = BACKLOG_DAYS.days.ago.to_date
49-
@cutoff_start_date = EventLog.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
49+
@cutoff_start_date = EventLog.unordered.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
5050
@start_time = Time.parse(ts)
5151

5252
Keygen.logger.info "[workers.prune-event-logs] Starting: start=#{start_time} cutoff_start=#{cutoff_start_date} cutoff_end=#{cutoff_end_date}"

app/workers/prune_metrics_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def perform(ts = Time.current.iso8601)
1414
BACKLOG_DAYS <= 0 # never prune -- keep metrics backlog forever
1515

1616
@cutoff_end_date = BACKLOG_DAYS.days.ago.to_date
17-
@cutoff_start_date = Metric.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
17+
@cutoff_start_date = Metric.unordered.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
1818
@start_time = Time.parse(ts)
1919

2020
Keygen.logger.info "[workers.prune-metrics] Starting: start=#{start_time} cutoff_start=#{cutoff_start_date} cutoff_end=#{cutoff_end_date}"

app/workers/prune_request_logs_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def perform(ts = Time.current.iso8601)
1414
BACKLOG_DAYS <= 0 # never prune -- keep request backlog forever
1515

1616
@cutoff_end_date = BACKLOG_DAYS.days.ago.to_date
17-
@cutoff_start_date = RequestLog.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
17+
@cutoff_start_date = RequestLog.unordered.where(created_date: ..cutoff_end_date).minimum(:created_date) || cutoff_end_date
1818
@start_time = Time.parse(ts)
1919

2020
Keygen.logger.info "[workers.prune-request-logs] Starting: start=#{start_time} cutoff_start=#{cutoff_start_date} cutoff_end=#{cutoff_end_date}"

0 commit comments

Comments
 (0)