retry 5 times on integrity error and then block processing
This commit is contained in:
parent
8549d73a20
commit
d552e364fc
3 changed files with 29 additions and 1 deletions
|
@ -8,6 +8,7 @@ class ActiveStorage::VirusScanner
|
|||
PENDING = 'pending'
|
||||
INFECTED = 'infected'
|
||||
SAFE = 'safe'
|
||||
INTEGRITY_ERROR = 'integrity_error'
|
||||
|
||||
def pending?
|
||||
blob.metadata[:virus_scan_result] == PENDING
|
||||
|
@ -21,6 +22,10 @@ class ActiveStorage::VirusScanner
|
|||
blob.metadata[:virus_scan_result] == SAFE
|
||||
end
|
||||
|
||||
def corrupt?
|
||||
blob.metadata[:virus_scan_result] == INTEGRITY_ERROR
|
||||
end
|
||||
|
||||
def done?
|
||||
started? && blob.metadata[:virus_scan_result] != PENDING
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue