2020-03-28 16:45:16 +01:00
|
|
|
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 }
|
2020-12-08 15:21:35 +01:00
|
|
|
Cron::CronJob.subclasses.each(&:schedule)
|
2020-03-28 16:45:16 +01:00
|
|
|
end
|
2020-04-01 15:26:46 +02:00
|
|
|
|
|
|
|
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 }
|
2020-12-08 15:21:35 +01:00
|
|
|
Cron::CronJob.subclasses.each(&:display_schedule)
|
2020-04-01 15:26:46 +02:00
|
|
|
end
|
2020-03-28 16:45:16 +01:00
|
|
|
end
|