add log for virus_scanner (#3859)
Remonte les informations en cas d'erreur lors de l'exécution de l'antivirus
This commit is contained in:
commit
e4517c7e98
1 changed files with 9 additions and 5 deletions
|
@ -35,12 +35,16 @@ class ActiveStorage::VirusScanner
|
||||||
end
|
end
|
||||||
|
|
||||||
def metadata
|
def metadata
|
||||||
download_blob_to_tempfile do |file|
|
begin
|
||||||
if ClamavService.safe_file?(file.path)
|
download_blob_to_tempfile do |file|
|
||||||
{ virus_scan_result: SAFE, scanned_at: Time.zone.now }
|
if ClamavService.safe_file?(file.path)
|
||||||
else
|
{ virus_scan_result: SAFE, scanned_at: Time.zone.now }
|
||||||
{ virus_scan_result: INFECTED, scanned_at: Time.zone.now }
|
else
|
||||||
|
{ virus_scan_result: INFECTED, scanned_at: Time.zone.now }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
rescue StandardError => e
|
||||||
|
Raven.capture_exception(e)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue