Merge pull request #5776 from betagouv/dev

2020-12-08-02
This commit is contained in:
LeSim 2020-12-08 15:32:19 +01:00 committed by GitHub
commit 29f15a857c
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 task schedule: :environment do
glob = Rails.root.join('app', 'jobs', '**', '*_job.rb') glob = Rails.root.join('app', 'jobs', '**', '*_job.rb')
Dir.glob(glob).each { |f| require f } Dir.glob(glob).each { |f| require f }
CronJob.subclasses.each(&:schedule) Cron::CronJob.subclasses.each(&:schedule)
end end
desc 'Display schedule for all cron jobs' desc 'Display schedule for all cron jobs'
task display_schedule: :environment do task display_schedule: :environment do
glob = Rails.root.join('app', 'jobs', '**', '*_job.rb') glob = Rails.root.join('app', 'jobs', '**', '*_job.rb')
Dir.glob(glob).each { |f| require f } Dir.glob(glob).each { |f| require f }
CronJob.subclasses.each(&:display_schedule) Cron::CronJob.subclasses.each(&:display_schedule)
end end
end end