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

11 lines
376 B
Ruby

class Cron::StalledDeclarativeProceduresJob < Cron::CronJob
self.schedule_expression = "every 10 minutes"
def perform
Procedure.declarative.find_each do |procedure|
procedure.dossiers.state_en_construction.where(declarative_triggered_at: nil).find_each do |dossier|
ProcessStalledDeclarativeDossierJob.perform_later(dossier)
end
end
end
end