提交 895c39fe 编写于 作者: A Aditya Narsapurkar

Updates to ActiveJob::Exceptions.retry_on with jitter documentation [skip ci]

- Changelog updated
- Method documentation updated
上级 9e5c6c4c
......@@ -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 ClassMethods
# ==== 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册