instance method
retry_on_handler
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
retry_on_handler(exceptions, wait, attempts, queue, priority, jitter, report, block)
No documentation comment.
Parameters
-
exceptionsreq -
waitreq -
attemptsreq -
queuereq -
priorityreq -
jitterreq -
reportreq -
blockreq
Source
# File activejob/lib/active_job/exceptions.rb, line 134
def retry_on_handler(exceptions, wait, attempts, queue, priority, jitter, report, block)
proc do |error|
executions = executions_for(exceptions)
if attempts == :unlimited || executions < attempts
ActiveSupport.error_reporter.report(error, source: "application.active_job") if report
retry_job wait: determine_delay(seconds_or_duration_or_algorithm: wait, executions: executions, error: error, jitter: jitter), queue: queue, priority: priority, error: error
else
if block
instrument :retry_stopped, error: error do
block.call(self, error)
end
run_after_discard_procs(error)
else
instrument :retry_stopped, error: error
run_after_discard_procs(error)
raise error
end
end
end
end
Defined in activejob/lib/active_job/exceptions.rb line 134
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveJob::Exceptions::ClassMethods