Merge pull request #5775 from betagouv/fix_cron_namespace

fix cron namespace
This commit is contained in:
LeSim 2020-12-08 15:30:06 +01:00 committed by GitHub
commit 66e08ed741
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,13 +3,13 @@ namespace :jobs do
task schedule: :environment do
glob = Rails.root.join('app', 'jobs', '**', '*_job.rb')
Dir.glob(glob).each { |f| require f }
CronJob.subclasses.each(&:schedule)
Cron::CronJob.subclasses.each(&:schedule)
end
desc 'Display schedule for all cron jobs'
task display_schedule: :environment do
glob = Rails.root.join('app', 'jobs', '**', '*_job.rb')
Dir.glob(glob).each { |f| require f }
CronJob.subclasses.each(&:display_schedule)
Cron::CronJob.subclasses.each(&:display_schedule)
end
end