From c7837c4fbeae7f436d16f42989a8652d44e32ec9 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 5 Jul 2024 17:43:13 +0200 Subject: [PATCH] Use newer syntax in documentation for `wait` config on `retry` (#1380) * Use newer syntax in documentation for `wait` config on `retry` good_job already handle both of course, but doc should provide that do not produce deprecation warnings like: ``` W, [2024-06-20T23:10:09.948834 #81411] WARN -- : DEPRECATION WARNING: `wait: :exponentially_longer` will actually wait polynomially longer and is therefore deprecated. Prefer `wait: :polynomially_longer` to avoid confusion and keep the same behavior. (called from at /Users/benoit.tigeot/projects/tooling/k8s-tooling-gw/app/jobs/task_webhook_job.rb:3) ``` * Fix double colons --------- Co-authored-by: Ben Sheldon [he/him] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 75e19231..d97dee07 100644 --- a/README.md +++ b/README.md @@ -933,7 +933,7 @@ Active Job can be configured to retry an infinite number of times, with a polyno ```ruby class ApplicationJob < ActiveJob::Base - retry_on StandardError, wait: :exponentially_longer, attempts: Float::INFINITY + retry_on StandardError, wait: :polynomially_longer, attempts: Float::INFINITY # ... end ``` @@ -953,7 +953,7 @@ When using `retry_on` with an infinite number of retries, exceptions will never ```ruby class ApplicationJob < ActiveJob::Base - retry_on StandardError, wait: :exponentially_longer, attempts: Float::INFINITY + retry_on StandardError, wait: :polynomially_longer, attempts: Float::INFINITY retry_on SpecialError, attempts: 5 do |_job, exception| Rails.error.report(exception) @@ -979,7 +979,7 @@ You can use an initializer to configure `ActionMailer::MailDeliveryJob`, for exa ```ruby # config/initializers/good_job.rb -ActionMailer::MailDeliveryJob.retry_on StandardError, wait: :exponentially_longer, attempts: Float::INFINITY +ActionMailer::MailDeliveryJob.retry_on StandardError, wait: :polynomially_longer, attempts: Float::INFINITY # With Sentry (or Bugsnag, Airbrake, Honeybadger, etc.) ActionMailer::MailDeliveryJob.around_perform do |_job, block|