module Sidekiq

def self.use_options(tmp_config = {})

Parameters:
  • tmp_config (Hash) -- the temporary config to use

Other tags:
    Note: - this method will restore the original options after yielding
def self.use_options(tmp_config = {})
  old_options = default_worker_options.dup
  default_worker_options.clear
  self.default_worker_options = tmp_config
  yield
ensure
  default_worker_options.clear
  self.default_worker_options = DEFAULT_WORKER_OPTIONS
  self.default_worker_options = old_options
end