Class: Sidekiq::Cron::ScheduleLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/cron/schedule_loader.rb

Instance Method Summary collapse

Instance Method Details

#has_schedule_file?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/sidekiq/cron/schedule_loader.rb', line 14

def has_schedule_file?
  File.exist?(schedule_file_name)
end

#load_scheduleObject



4
5
6
7
8
9
10
11
12
# File 'lib/sidekiq/cron/schedule_loader.rb', line 4

def load_schedule
  if schedule.is_a?(Hash)
    Sidekiq::Cron::Job.load_from_hash!(schedule, source: "schedule")
  elsif schedule.is_a?(Array)
    Sidekiq::Cron::Job.load_from_array!(schedule, source: "schedule")
  else
    raise "Not supported schedule format. Confirm your #{schedule_file_name}"
  end
end