instance method determine_delay

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

determine_delay(seconds_or_duration_or_algorithm)

No documentation comment.

Parameters

seconds_or_duration_or_algorithm req
Source
# File activejob/lib/active_job/exceptions.rb, line 116
      def determine_delay(seconds_or_duration_or_algorithm)
        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 116 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::Exceptions

Type at least 2 characters to search.

↑↓ navigate · open · esc close