From 0d8990e242eedddfe7f5351c4624af33cad6fe9a Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Wed, 17 Apr 2024 10:27:22 +0100 Subject: [PATCH] Update application form section status This ensures that the malware scan result will keep the section statuses up to date. --- app/jobs/update_malware_scan_result_job.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/jobs/update_malware_scan_result_job.rb b/app/jobs/update_malware_scan_result_job.rb index b34bb16c26..9b46b7c059 100644 --- a/app/jobs/update_malware_scan_result_job.rb +++ b/app/jobs/update_malware_scan_result_job.rb @@ -6,8 +6,14 @@ class UpdateMalwareScanResultJob < ApplicationJob def perform(upload) FetchMalwareScanResult.call(upload:) - # This will ensure the job is automatically retried. - raise StillPending if upload.malware_scan_pending? + if upload.malware_scan_pending? + # This will ensure the job is automatically retried. + raise StillPending + else + ApplicationFormSectionStatusUpdater.call( + application_form: upload.application_form, + ) + end end class StillPending < StandardError