Module: Sidekiq::Worker::ClassMethods

Defined in:
lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb

Instance Method Summary collapse

Instance Method Details

#clearObject

Clear all jobs for this worker


9
10
11
12
13
14
15
16
# File 'lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb', line 9

def clear
  jobs.each do |job|
    unlock(job) if Sidekiq::Testing.fake?
  end

  Sidekiq::Queues[queue].clear
  jobs.clear
end

#execute_job(worker, args) ⇒ Object


19
20
21
# File 'lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb', line 19

def execute_job(worker, args)
  worker.perform(*args)
end

#unlock(job) ⇒ Object


24
25
26
# File 'lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb', line 24

def unlock(job)
  SidekiqUniqueJobs::Unlockable.unlock(job)
end