Module: Sidekiq Private
- Defined in:
- lib/sidekiq_unique_jobs/testing.rb,
lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: Worker Classes: JobRecord, JobSet, Queue, ScheduledSet, SortedEntry
Class Method Summary collapse
-
.use_options(tmp_config = {}) ⇒ Object
Temporarily turn Sidekiq’s options into something different.
Class Method Details
.use_options(tmp_config = {}) ⇒ Object
Note:
this method will restore the original options after yielding
Temporarily turn Sidekiq’s options into something different
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/sidekiq_unique_jobs/testing.rb', line 29 def self.(tmp_config = {}) if respond_to?(:default_job_options) .clear self. = tmp_config else .clear self. = tmp_config end yield ensure if respond_to?(:default_job_options) .clear self. = else .clear self. = DEFAULT_WORKER_OPTIONS end end |