method
determine_delay
v6.0.0 -
Show latest stable
- Class:
ActiveJob::Exceptions
determine_delay(seconds_or_duration_or_algorithm:, executions:)private
No documentation available.
# File activejob/lib/active_job/exceptions.rb, line 124
def determine_delay(seconds_or_duration_or_algorithm,, executions))
case seconds_or_duration_or_algorithm
when :exponentially_longer
(executions**4) + 2
when ActiveSupport::Duration
duration = seconds_or_duration_or_algorithm
duration.to_i
when Integer
seconds = seconds_or_duration_or_algorithm
seconds
when Proc
algorithm = seconds_or_duration_or_algorithm
algorithm.call(executions)
else
raise "Couldn't determine a delay based on #{seconds_or_duration_or_algorithm.inspect}"
end
end