Skip to content

Commit

Permalink
Merge pull request #9874 from DFE-Digital/run-decline-by-default-work…
Browse files Browse the repository at this point in the history
…er-over-shorter-time

Run decline by default job more quickly
  • Loading branch information
elceebee authored Sep 26, 2024
2 parents feea49c + b3aa4e3 commit 4b8e131
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/workers/end_of_cycle/decline_by_default_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b8e131

Please sign in to comment.