Class: Sidekiq::Cron::Poller

Inherits:
Scheduled::Poller
  • Object
show all
Defined in:
lib/sidekiq/cron/poller.rb

Overview

The Poller checks Redis every N seconds for sheduled cron jobs

Instance Method Summary collapse

Instance Method Details

#enqueueObject


12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sidekiq/cron/poller.rb', line 12

def enqueue
  time = Time.now.utc
  Sidekiq::Cron::Job.all.each do |job|
    enqueue_job(job, time)
  end
rescue => ex
  # Most likely a problem with redis networking.
  # Punt and try again at the next interval
  Sidekiq.logger.error ex.message
  Sidekiq.logger.error ex.backtrace.first
  handle_exception(ex) if respond_to?(:handle_exception)
end