Skip to content

Commit d2f3795

Browse files
Merge pull request #6510 from NHSDigital/fix-cli-mavis-vaccination-records-sync
Fix Mavis CLI vaccination-records sync
2 parents b41824a + 698a102 commit d2f3795

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • app/lib/mavis_cli/vaccination_records

app/lib/mavis_cli/vaccination_records/sync.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ def call(vaccination_record_id:, **)
3030
return
3131
end
3232

33-
vaccination_record.update!(
34-
nhs_immunisations_api_sync_pending_at: Time.current
33+
# Do not trigger the sync through the commit hook as we want to perform
34+
# the sync synchronously instead of enqueueing a background job.
35+
vaccination_record.update_columns(
36+
nhs_immunisations_api_sync_pending_at: Time.current,
37+
touch: true
3538
)
3639
NHS::ImmunisationsAPI.sync_immunisation(vaccination_record)
3740
puts "Successfully synced vaccination record #{vaccination_record_id}"

0 commit comments

Comments
 (0)