module Sidekiq
@api private
See Sidekiq
gem for more details
Public Class Methods
Source
# File lib/sidekiq_unique_jobs/testing.rb, line 24 def self.use_options(tmp_config = {}) if respond_to?(:default_job_options) default_job_options.clear self.default_job_options = tmp_config else default_worker_options.clear self.default_worker_options = tmp_config end yield ensure if respond_to?(:default_job_options) default_job_options.clear self.default_job_options = default_job_options else default_worker_options.clear self.default_worker_options = DEFAULT_WORKER_OPTIONS end end
Temporarily turn Sidekiq’s options into something different
@note this method will restore the original options after yielding
@param [Hash<Symbol, Object>] tmp_config the temporary config to use