2016-10-10 17:55:20 +00:00
|
|
|
* Removed deprecated `#original_exception` in `ActiveJob::DeserializationError`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2016-08-23 03:38:42 +00:00
|
|
|
* Added instance variable `@queue` to JobWrapper.
|
|
|
|
|
|
|
|
This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method,
|
|
|
|
so we can use `#enqueue_delayed_selection`, `#remove_delayed` method in resque-scheduler smoothly.
|
|
|
|
|
|
|
|
*mu29*
|
2016-08-02 22:04:45 +00:00
|
|
|
|
2016-08-16 23:01:59 +00:00
|
|
|
* Yield the job instance so you have access to things like `job.arguments` on the custom logic after retries fail.
|
|
|
|
|
|
|
|
*DHH*
|
|
|
|
|
2016-08-23 03:38:42 +00:00
|
|
|
* Added declarative exception handling via `ActiveJob::Base.retry_on` and `ActiveJob::Base.discard_on`.
|
2016-08-02 22:04:45 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
class RemoteServiceJob < ActiveJob::Base
|
|
|
|
retry_on CustomAppException # defaults to 3s wait, 5 attempts
|
|
|
|
retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 }
|
2016-10-08 23:46:31 +00:00
|
|
|
retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3
|
2016-08-02 22:04:45 +00:00
|
|
|
retry_on Net::OpenTimeout, wait: :exponentially_longer, attempts: 10
|
|
|
|
discard_on ActiveJob::DeserializationError
|
|
|
|
|
|
|
|
def perform(*args)
|
|
|
|
# Might raise CustomAppException or AnotherCustomAppException for something domain specific
|
2016-10-08 23:46:31 +00:00
|
|
|
# Might raise ActiveRecord::Deadlocked when a local db deadlock is detected
|
2016-08-02 22:04:45 +00:00
|
|
|
# Might raise Net::OpenTimeout when the remote service is down
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
*DHH*
|
2016-05-06 21:54:40 +00:00
|
|
|
|
2016-08-18 07:44:28 +00:00
|
|
|
|
2016-05-10 04:07:09 +00:00
|
|
|
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activejob/CHANGELOG.md) for previous changes.
|