demarches-normaliennes/app/jobs/cron/fix_missing_antivirus_analysis_job.rb

13 lines
337 B
Ruby
Raw Normal View History

2020-12-17 10:54:12 +01:00
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