diff options
Diffstat (limited to 'activejob/lib/active_job/exceptions.rb')
-rw-r--r-- | activejob/lib/active_job/exceptions.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activejob/lib/active_job/exceptions.rb b/activejob/lib/active_job/exceptions.rb index d236f03d53..dfc74deb1a 100644 --- a/activejob/lib/active_job/exceptions.rb +++ b/activejob/lib/active_job/exceptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/numeric/time" module ActiveJob @@ -17,7 +19,7 @@ module ActiveJob # ==== Options # * <tt>:wait</tt> - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds), # as a computing proc that the number of executions so far as an argument, or as a symbol reference of - # <tt>:exponentially_longer<>, which applies the wait algorithm of <tt>(executions ** 4) + 2</tt> + # <tt>:exponentially_longer</tt>, which applies the wait algorithm of <tt>(executions ** 4) + 2</tt> # (first wait 3s, then 18s, then 83s, etc) # * <tt>:attempts</tt> - Re-enqueues the job the specified number of times (default: 5 attempts) # * <tt>:queue</tt> - Re-enqueues the job on a different queue @@ -104,7 +106,7 @@ module ActiveJob def determine_delay(seconds_or_duration_or_algorithm) case seconds_or_duration_or_algorithm when :exponentially_longer - (executions ** 4) + 2 + (executions**4) + 2 when ActiveSupport::Duration duration = seconds_or_duration_or_algorithm duration.to_i |