From b3aa4e39788aec7d9b4d2e78b0586e0ea9871bb3 Mon Sep 17 00:00:00 2001 From: Lori Bailey <44073106+elceebee@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:44:41 +0100 Subject: [PATCH] Run decline by default job more quickly --- app/workers/end_of_cycle/decline_by_default_worker.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/workers/end_of_cycle/decline_by_default_worker.rb b/app/workers/end_of_cycle/decline_by_default_worker.rb index 3d9f9c88a79..1a70d230ea1 100644 --- a/app/workers/end_of_cycle/decline_by_default_worker.rb +++ b/app/workers/end_of_cycle/decline_by_default_worker.rb @@ -3,11 +3,12 @@ class DeclineByDefaultWorker include Sidekiq::Worker BATCH_SIZE = 120 + STAGGER_OVER = 1.minute def perform(force: false) return unless CycleTimetable.run_decline_by_default? || force - BatchDelivery.new(relation:, batch_size: BATCH_SIZE).each do |batch_time, applications| + BatchDelivery.new(relation:, stagger_over: STAGGER_OVER, batch_size: BATCH_SIZE).each do |batch_time, applications| DeclineByDefaultSecondaryWorker.perform_at(batch_time, applications.pluck(:id)) end end