lib/sidekiq/scheduler.rb
# Pulls the schedule from Sidekiq.schedule and loads it into the
# rufus scheduler instance
Pulls the schedule from Sidekiq.schedule and loads it into the
rufus scheduler instance
Pulls the schedule from Sidekiq . schedule and loads it into the rufus scheduler instance
def load_schedule!
        if enabled
          logger.info 'Loading Schedule'
          if dynamic
            Sidekiq.reload_schedule!
            rufus_scheduler.every('5s') do
              update_schedule
            end
          end
          logger.info 'Schedule empty! Set Sidekiq.schedule' if Sidekiq.schedule.empty?
          @@scheduled_jobs = {}
          Sidekiq.schedule.each do |name, config|
            if !listened_queues_only || enabled_queue?(config['queue'])
              load_schedule_job(name, config)
            else
              logger.info { "Ignoring #{name}, job's queue is not enabled." }
            end
          end
          Sidekiq.redis { |r| r.del(:schedules_changed) }
          logger.info 'Schedules Loaded'
        else
          logger.info 'SidekiqScheduler is disabled'
        end
      end
def load_schedule! if enabled logger . info 'Loading Schedule' if dynamic Sidekiq . reload_schedule! rufus_scheduler . every ( '5s' ) do update_schedule end end logger . info 'Schedule empty! Set Sidekiq.schedule' if Sidekiq . schedule . empty? @@scheduled_jobs = { } Sidekiq . schedule . each do | name , config | if ! listened_queues_only || enabled_queue? ( config [ 'queue' ] ) load_schedule_job ( name , config ) else logger . info { "Ignoring #{name}, job's queue is not enabled." } end end Sidekiq . redis { | r | r . del ( :schedules_changed ) } logger . info 'Schedules Loaded' else logger . info 'SidekiqScheduler is disabled' end end
Pulls the schedule from Sidekiq.schedule and loads it into the
rufus scheduler instance
Pulls the schedule from Sidekiq . schedule and loads it into the rufus scheduler instance
# Load schedule from redis for the first time if dynamic