Module: RocketJob::Plugins::Cron

Extended by:
ActiveSupport::Concern
Included in:
Jobs::DirmonJob, Jobs::HousekeepingJob, Jobs::OnDemandBatchJob, Jobs::OnDemandJob
Defined in:
lib/rocket_job/plugins/cron.rb

Overview

Allow jobs to run on a predefined schedule, much like a crontab.

Notes:

  • No single point of failure since their is no centralized scheduler.
  • cron_schedule can be edited at any time via the web interface.
  • A scheduled job can be run at any time by calling #run_now! or by clicking Run Now in the web interface.

Instance Method Summary collapse

Instance Method Details

#rocket_job_cron_set_run_atObject



58
59
60
61
62
# File 'lib/rocket_job/plugins/cron.rb', line 58

def rocket_job_cron_set_run_at
  return if cron_schedule.nil? || !(cron_schedule_changed? && !run_at_changed?)

  self.run_at = Fugit::Cron.new(cron_schedule).next_time.to_utc_time
end