diff --git a/app/jobs/virus_scanner_job.rb b/app/jobs/virus_scanner_job.rb index 9cf005e00..29e6f1db6 100644 --- a/app/jobs/virus_scanner_job.rb +++ b/app/jobs/virus_scanner_job.rb @@ -1,7 +1,10 @@ class VirusScannerJob < ApplicationJob queue_as :active_storage_analysis + # If by the time the job runs the blob has been deleted, ignore the error discard_on ActiveRecord::RecordNotFound + # If the file is deleted during the scan, ignore the error + discard_on ActiveStorage::FileNotFoundError def perform(blob) metadata = extract_metadata_via_virus_scanner(blob)