Merge pull request #38702 from aditya-vector/activejob-jitter-documentation-update

Updates to ActiveJob::Exceptions.retry_on with jitter documentation [skip ci]
This commit is contained in:
Rafael França 2020-03-11 13:43:19 -04:00 committed by GitHub
commit d2d8b2892d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -79,9 +79,9 @@
*Vlado Cingel*
* Add jitter to :exponentially_longer.
* Add jitter to `ActiveJob::Exceptions.retry_on`.
ActiveJob::Exceptions.retry_on with :exponentially_longer now uses a random amount of jitter in order to
`ActiveJob::Exceptions.retry_on` now uses a random amount of jitter in order to
prevent the [thundering herd effect](https://en.wikipedia.org/wiki/Thundering_herd_problem). Defaults to
15% (represented as 0.15) but overridable via the `:jitter` option when using `retry_on`.
Jitter is applied when an `Integer`, `ActiveSupport::Duration` or `:exponentially_longer`, is passed to the `wait` argument in `retry_on`.

View File

@ -23,7 +23,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</tt>, which applies the wait algorithm of <tt>((executions**4) + (Kernel.rand((executions**4) * jitter))) + 2</tt>
# <tt>:exponentially_longer</tt>, which applies the wait algorithm of <tt>((executions**4) + (Kernel.rand * (executions**4) * jitter)) + 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