From 142869bf98d9229662e37b50d969653d3996d88f Mon Sep 17 00:00:00 2001 From: Devin Gaffney Date: Wed, 13 Sep 2023 18:11:45 -0700 Subject: [PATCH] CV2-3589 refactor to not uselessly explode all the tests and rewrite them with a meaningless null value --- app/models/bot/fetch.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/bot/fetch.rb b/app/models/bot/fetch.rb index aaf8142a6d..60628b77fd 100644 --- a/app/models/bot/fetch.rb +++ b/app/models/bot/fetch.rb @@ -171,7 +171,9 @@ def self.import_claim_reviews(installation_id, language = nil, force = false, ma (from.to_i..to.to_i).step(step.days).each do |current_timestamp| from2 = Time.at(current_timestamp) to2 = from2 + step.days - Bot::Fetch.get_claim_reviews({ service: service_name, start_time: from2.strftime('%Y-%m-%d'), end_time: to2.strftime('%Y-%m-%d'), language: language}).each do |claim_review| + params = { service: service_name, start_time: from2.strftime('%Y-%m-%d'), end_time: to2.strftime('%Y-%m-%d'), language: language} + params[:language] = language if !language.nil? + Bot::Fetch.get_claim_reviews(params).each do |claim_review| next if !maximum.nil? && total >= maximum self.import_claim_review(claim_review, team.id, user.id, status_fallback, status_mapping, auto_publish_reports, force) total += 1