16

Is it possible to move sidekiq job straight to dead queue from SidekiqWorker instance level (i.e. while executing)

class MyWorker
  include Sidekiq::Worker
  sidekiq_options retry: 9

  def perform(name)
    if name == 'StackOverflow'
      # ----> skip_retry_queue_and_go_to_dead_queue
    else 
      # do_stuff!
    end
  end
end
Filip Bartuzi
  • 5,711
  • 7
  • 54
  • 102

1 Answers1

5

Not dynamically within an executing job.

Statically, if you set sidekiq_options retry: 0, the job will go straight to the Dead set if it raises an error.

https://github.com/mperham/sidekiq/wiki/Error-Handling#configuration

Mike Perham
  • 21,300
  • 6
  • 59
  • 61