Add cron to complete missing analysis

This commit is contained in:
simon lehericey 2020-12-17 10:54:12 +01:00
parent 03107d095b
commit 1348b883e3

View file

@ -0,0 +1,12 @@
class Cron::FixMissingAntivirusAnalysis < Cron::CronJob
self.schedule_expression = "every day at 2 am"
def perform
ActiveStorage::Blob.where("metadata like '%\"virus_scan_result\":\"pending%'").each do |b|
begin
VirusScannerJob.perform_now(b)
rescue ActiveStorage::IntegrityError
end
end
end
end