lib/rocket_job/plugins/retry.rb in rocketjob-3.4.3 vs lib/rocket_job/plugins/retry.rb in rocketjob-3.5.0

- old
+ new

@@ -75,12 +75,12 @@ delay_seconds = rocket_job_retry_seconds_to_delay logger.info "Job failed, automatically retrying in #{delay_seconds} seconds. Retry count: #{failure_count}" now = Time.now self.run_at = now + delay_seconds - self.failed_at_list << now - new_record? ? self.retry : self.retry! + failed_at_list << now + new_record? ? self.retry : retry! end # Prevent exception from being cleared on retry def rocket_job_clear_exception self.completed_at = nil @@ -91,9 +91,8 @@ # Returns [Time] when to retry this job at # Same basic formula as Delayed Job def rocket_job_retry_seconds_to_delay (rocket_job_failure_count ** 4) + 15 + (rand(30) * (rocket_job_failure_count + 1)) end - end end end