From fece1d439224a682e9574865fcbea9066d692642 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:15:18 +0100 Subject: [PATCH] Filter logs by status to only process completed entries in InvalidLogsHelper --- app/helpers/invalid_logs_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/helpers/invalid_logs_helper.rb b/app/helpers/invalid_logs_helper.rb index ae3026a28..0d295e11a 100644 --- a/app/helpers/invalid_logs_helper.rb +++ b/app/helpers/invalid_logs_helper.rb @@ -7,6 +7,8 @@ module InvalidLogsHelper model.filter_by_year(year).find_in_batches(batch_size: 1000).with_index(1) do |batch, batch_index| Rails.logger.info "Processing batch #{batch_index} with #{batch.size} logs..." batch.each do |log| + next unless log.status == "completed" + total_logs_seen += 1 invalid_ids << log.id unless log.valid? end @@ -27,6 +29,8 @@ module InvalidLogsHelper model.filter_by_year(year).find_in_batches(batch_size: 1000).with_index(1) do |batch, batch_index| Rails.logger.info "Processing batch #{batch_index} with #{batch.size} logs..." batch.each do |log| + next unless log.status == "completed" + total_logs_seen += 1 next if log.valid?