Answers for "cancel sidekiq worker by class"

0

cancel sidekiq worker by class

queue = Sidekiq::Queue.new("mailer")
queue.each do |job|
  job.klass # => 'MyWorker'
  job.args # => [1, 2, 3]
  job.delete if job.jid == 'abcdef1234567890'
end
Posted by: Guest on April-19-2021

Browse Popular Code Answers by Language