class SidekiqRepeatingJobs::Config
Constants
- DEFAULT_EXPIRATION_SECONDS
- DEFAULT_REPEAT_SECONDS
Public Class Methods
active?(worker_class)
click to toggle source
# File lib/sidekiq_repeating_jobs/config.rb, line 10 def active?(worker_class) worker_class.get_sidekiq_options['repeat'].present? end
expiration_interval(worker_class)
click to toggle source
# File lib/sidekiq_repeating_jobs/config.rb, line 22 def expiration_interval(worker_class) self.repeat_interval(worker_class) + (worker_class.get_sidekiq_options['repeating_job_expiration'] || DEFAULT_EXPIRATION_SECONDS) end
job_name(worker_class)
click to toggle source
# File lib/sidekiq_repeating_jobs/config.rb, line 14 def job_name(worker_class) worker_class.get_sidekiq_options['repeating_job_name'] || worker_class.name.demodulize.underscore end
repeat_interval(worker_class)
click to toggle source
# File lib/sidekiq_repeating_jobs/config.rb, line 18 def repeat_interval(worker_class) (r = worker_class.get_sidekiq_options['repeat']).is_a?(Fixnum) ? r : DEFAULT_REPEAT_SECONDS end