mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Updates to ActiveJob::Exceptions.retry_on with jitter documentation [skip ci]
- Changelog updated - Method documentation updated
This commit is contained in:
parent
9e5c6c4c84
commit
895c39fe96
2 changed files with 3 additions and 3 deletions
|
@ -69,9 +69,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`.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue