Merge pull request #5531 from betagouv/ignore-deleted-file-in-virus-scan
jobs: ignore deleted file in Virus Scan
This commit is contained in:
commit
a51d6046dc
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue