module Sidekiq::Worker::ClassMethods

def clear


Clears the jobs for this worker and removes all locks
def clear
  jobs.each do |job|
    SidekiqUniqueJobs::Unlockable.unlock(job)
  end
  Sidekiq::Queues[queue].clear
  jobs.clear
end

def use_options(tmp_config = {})

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

Other tags:
    Note: - this method will restore the original configuration after yielding
def use_options(tmp_config = {})
  old_config = get_sidekiq_options
  sidekiq_options(tmp_config)
  yield
ensure
  self.sidekiq_options_hash = Sidekiq.default_worker_options
  sidekiq_options(old_config)
end