Skip to content

Commit 15fd7d3

Browse files
committed
Remove hardcoded batch size from find_in_batches in PatientStatusUpdater
While working on needs-consent sub-statuses and running data-replication performance tests, we found that large batches were slow to process, while a smaller batch size of 1000 completed significantly faster.
1 parent f807fb4 commit 15fd7d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/lib/patient_status_updater.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def update_registration_statuses!
9292
.joins(session: :team_location)
9393
.where(team_location: { academic_year: academic_years })
9494
.includes(:attendance_records, :patient, :session, :vaccination_records)
95-
.find_in_batches(batch_size: 10_000) do |batch|
95+
.find_in_batches do |batch|
9696
batch.each(&:assign_status)
9797

9898
Patient::RegistrationStatus.import!(

0 commit comments

Comments
 (0)