Reputation: 5931
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
Upvotes: 16
Views: 3218
Reputation: 179
class MyWorker
include Sidekiq::Worker
sidekiq_options retry: 9
def perform(name)
if name == 'StackOverflow'
:kill
else
# do_stuff!
end
end
end
Upvotes: -1
Reputation: 22208
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
Upvotes: 5