Is there a way to disable automatic retry with ActiveJob and Sidekiq ?
I know that with Sidekiq only, we just have to put
sidekiq_options :retry => f
You can catch up the exception and to do nothing instead retry or to configure retry:
class ExampleJob < ActiveJob::Base
rescue_from(StandardError) do |exception|
Rails.logger.error "[#{self.class.name}] Hey, something was wrong with you job #{exception.to_s}"
end
def perform
raise StandardError, "error_message"
end
end
class ExampleJob < ActiveJob::Base
rescue_from(StandardError) do |exception|
retry_job wait: 5.minutes, queue: :low_priority
end
def perform
raise StandardError, "error_message"
end
end
For running retrying you can use retry_on method retry_on method doc
Sidekiq wiki for retries with Active Job integration