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_options = sidekiq_options_hash.dup
  sidekiq_options(old_options.merge(tmp_config))
  yield
ensure
  self.sidekiq_options_hash = Sidekiq::DEFAULT_WORKER_OPTIONS
  sidekiq_options(old_options)
end