Skip to content

Commit 5046477

Browse files
authored
Increase interval between PDS jobs (#2936)
We're still seeing the issue in production where the PDS jobs get stuck in a state where none of them can process successfully. Running some experiments by queueing the jobs manually via a Rails console suggests a 2 second interval between the jobs is handled much better, although it means that it'll take ~11 hours to process all the patients.
2 parents 7572dc8 + 8475719 commit 5046477

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

app/jobs/bulk_update_patients_from_pds_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def perform
2525

2626
PatientUpdateFromPDSJob.set(
2727
priority: 50,
28-
wait: 0.5 * index
28+
wait: 2 * index
2929
).perform_later(patient)
3030
end
3131
end

app/models/concerns/csv_importable.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,10 @@ def update_from_pds
172172
# should reduce the risk of this.
173173

174174
if patient.nhs_number.nil?
175-
PatientNHSNumberLookupJob.set(wait: 0.5 * index).perform_later(
176-
patient
177-
)
175+
PatientNHSNumberLookupJob.set(wait: 2 * index).perform_later(patient)
178176
else
179177
PatientUpdateFromPDSJob.set(
180-
wait: 0.5 * index,
178+
wait: 2 * index,
181179
queue: :imports
182180
).perform_later(patient)
183181
end

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
config.good_job.enable_cron = true
120120
config.good_job.cron = {
121121
bulk_update_patients_from_pds: {
122-
cron: "every day at 00:00 and 8:00 and 12:00 and 18:00",
122+
cron: "every day at 6:00 and 18:00",
123123
class: "BulkUpdatePatientsFromPDSJob",
124124
description: "Keep patient details up to date with PDS."
125125
},

0 commit comments

Comments
 (0)