instance method
determine_delay
Ruby on Rails 6.0.6
Since v5.2.8.1 PrivateSignature
determine_delay(seconds_or_duration_or_algorithm:, executions:)
No documentation comment.
Parameters
-
seconds_or_duration_or_algorithmkeyreq -
executionskeyreq
Source
# 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
Defined in activejob/lib/active_job/exceptions.rb line 124
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveJob::Exceptions