From 111227c0dfb72b060428063e35d865b62338654a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 2 Aug 2016 12:28:16 -0700 Subject: Please Rubocup --- activejob/lib/active_job/exceptions.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activejob/lib/active_job/exceptions.rb') diff --git a/activejob/lib/active_job/exceptions.rb b/activejob/lib/active_job/exceptions.rb index 33388816e9..5488a86756 100644 --- a/activejob/lib/active_job/exceptions.rb +++ b/activejob/lib/active_job/exceptions.rb @@ -15,7 +15,7 @@ module ActiveJob # the exception bubble up. # # ==== Options - # * :wait - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds), + # * :wait - 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 # :exponentially_longer<>, which applies the wait algorithm of (executions ** 4) + 2 # (first wait 3s, then 18s, then 83s, etc) @@ -45,7 +45,7 @@ module ActiveJob if executions < attempts logger.error "Retrying #{self.class} in #{wait} seconds, due to a #{exception}. The original exception was #{error.cause.inspect}." retry_job wait: determine_delay(wait), queue: queue, priority: priority - else + else if block_given? yield exception else @@ -112,6 +112,6 @@ module ActiveJob algorithm = seconds_or_algorithm algorithm.call(executions) end - end + end end end -- cgit v1.2.3