Skip to content

Commit

Permalink
Use newer syntax in documentation for wait config on retry (#1380)
Browse files Browse the repository at this point in the history
* 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 <class:TaskWebhookJob> 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] <bensheldon@gmail.com>
  • Loading branch information
benoittgt and bensheldon committed Jul 5, 2024
1 parent 2b17bb7 commit c7837c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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)
Expand All @@ -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|
Expand Down

0 comments on commit c7837c4

Please sign in to comment.