Move sidekiq work directly to the dead line

Is it possible to move sidekiq work directly to the dead queue from the SidekiqWorker instance level (i.e. at runtime)

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
+6
source share
2 answers

No. You can just go returnthere and the task will not be repeated (since it will be considered successful).

+3
source

Not dynamically as part of the job.

Statically, if you install sidekiq_options retry: 0, the task goes directly to the Dead set if it causes an error.

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

0
source

Source: https://habr.com/ru/post/1617723/


All Articles