2021-01-19 09:57:46 -05:00
|
|
|
* Communicate enqueue failures to callers of `perform_later`.
|
|
|
|
|
|
|
|
`perform_later` can now optionally take a block which will execute after
|
|
|
|
the adapter attempts to enqueue the job. The block will receive the job
|
|
|
|
instance as an argument even if the enqueue was not successful.
|
2021-02-06 15:41:07 -05:00
|
|
|
Additionally, `ActiveJob` adapters now have the ability to raise an
|
2021-01-19 09:57:46 -05:00
|
|
|
`ActiveJob::EnqueueError` which will be caught and stored in the job
|
|
|
|
instance so code attempting to enqueue jobs can inspect any raised
|
|
|
|
`EnqueueError` using the block.
|
|
|
|
|
|
|
|
MyJob.perform_later do |job|
|
|
|
|
unless job.successfully_enqueued?
|
|
|
|
if job.enqueue_error&.message == "Redis was unavailable"
|
|
|
|
# invoke some code that will retry the job after a delay
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
*Daniel Morton*
|
|
|
|
|
2021-02-01 20:06:49 -05:00
|
|
|
* Don't log rescuable exceptions defined with `rescue_from`.
|
2020-11-02 16:12:47 -05:00
|
|
|
|
2020-12-24 12:41:54 -05:00
|
|
|
*Hu Hailin*
|
2020-06-22 10:09:14 -04:00
|
|
|
|
2021-01-22 16:07:53 -05:00
|
|
|
* Allow `rescue_from` to rescue all exceptions.
|
2020-11-02 16:12:47 -05:00
|
|
|
|
2021-01-22 16:07:53 -05:00
|
|
|
*Adrianna Chang*, *Étienne Barrié*
|
2020-06-22 10:09:14 -04:00
|
|
|
|
2020-12-30 01:06:09 -05:00
|
|
|
|
2020-12-02 18:37:26 -05:00
|
|
|
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activejob/CHANGELOG.md) for previous changes.
|