Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move sidekiq job straight to dead queue

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
like image 553
Filip Bartuzi Avatar asked Nov 27 '15 11:11

Filip Bartuzi


1 Answers

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

like image 77
Mike Perham Avatar answered Oct 29 '22 21:10

Mike Perham