Class: Sidekiq::Scheduled::Poller
- Inherits:
-
Object
- Object
- Sidekiq::Scheduled::Poller
- Defined in:
- lib/sidekiq/scheduled.rb
Overview
The Poller checks Redis every N seconds for jobs in the retry or scheduled set have passed their timestamp and should be enqueued. If so, it just pops the job back onto its original queue so the workers can pick it up like any other job.
Constant Summary collapse
- INITIAL_WAIT =
10
Constants included from Util
Instance Method Summary collapse
-
#initialize ⇒ Poller
constructor
A new instance of Poller.
- #poll(first_time = false) ⇒ Object
Methods included from Actor
Methods included from Util
#fire_event, #hostname, #identity, #logger, #process_nonce, #redis, #want_a_hertz_donut?, #watchdog
Methods included from ExceptionHandler
Constructor Details
Instance Method Details
#poll(first_time = false) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sidekiq/scheduled.rb', line 50 def poll(first_time=false) watchdog('scheduling poller thread died!') do initial_wait if first_time begin @enq.enqueue_jobs rescue => ex # Most likely a problem with redis networking. # Punt and try again at the next interval logger.error ex. logger.error ex.backtrace.first end after(random_poll_interval) { poll } end end |