demarches-normaliennes/lib/tasks/jobs.rake
2020-03-31 12:25:46 +02:00

8 lines
236 B
Ruby

namespace :jobs do
desc 'Schedule all cron jobs'
task schedule: :environment do
glob = Rails.root.join('app', 'jobs', '**', '*_job.rb')
Dir.glob(glob).each { |f| require f }
CronJob.subclasses.each(&:schedule)
end
end