Module: Sidekiq::Worker::ClassMethods
- Includes:
- Overrides::ClassMethods
- Defined in:
- lib/sidekiq_unique_jobs/testing.rb,
lib/sidekiq_unique_jobs/testing.rb
Overview
Prepends methods to Sidekiq::Worker
Instance Method Summary collapse
-
#use_options(tmp_config = {}) ⇒ Object
Temporarily turn a workers sidekiq_options into something different.
Methods included from Overrides::ClassMethods
Instance Method Details
#use_options(tmp_config = {}) ⇒ Object
Note:
this method will restore the original configuration after yielding
Temporarily turn a workers sidekiq_options into something different
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/sidekiq_unique_jobs/testing.rb', line 59 def (tmp_config = {}) = .dup (.merge(tmp_config)) yield ensure self. = if Sidekiq.respond_to?(:default_job_options) Sidekiq. else DEFAULT_WORKER_OPTIONS end () end |