Class: Sidekiq::Cron::Poller
- Inherits:
-
Scheduled::Poller
- Object
- Scheduled::Poller
- Sidekiq::Cron::Poller
- Defined in:
- lib/sidekiq/cron/poller.rb
Overview
The Poller checks Redis every N seconds for scheduled cron jobs.
Instance Method Summary collapse
- #enqueue ⇒ Object
-
#initialize(config = nil) ⇒ Poller
constructor
A new instance of Poller.
- #start ⇒ Object
Constructor Details
#initialize(config = nil) ⇒ Poller
Returns a new instance of Poller.
9 10 11 |
# File 'lib/sidekiq/cron/poller.rb', line 9 def initialize(config = nil) super end |
Instance Method Details
#enqueue ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sidekiq/cron/poller.rb', line 19 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. Sidekiq.logger.error ex.backtrace.first handle_exception(ex) if respond_to?(:handle_exception) end |