Flowdock
method

determine_delay

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: Exceptions
determine_delay(seconds_or_duration_or_algorithm) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide 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
Register or log in to add new notes.