aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/jobs/retry_job.rb
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite ActiveJob exception tests so it runs with the real adaptersRosa Gutierrez2019-01-081-1/+7
| | | | | | | | | Previously, by extending ActiveJob::TestCase, the test adapter provided for tests was being used always, in all executions where supposedly different adapters were being used. As a consequence, some bugs visible only for some adapters might have gone undetected. This commit changes that, skipping queue adapters for which we can't test scheduling jobs with a delay.
* Support in-flight jobs stored before individual execution counters for ↵Rosa Gutierrez2019-01-051-11/+3
| | | | | | | | | | | | | | | | | | | | `retry_on` (#34731) Also, make tests and examples for individual execution counters clearer, as it wasn't entierly clear what would happen in this case: ``` retry_on CustomException, OtherException, attempts: 3 ``` The job would be retried at most 3 times in total, for both CustomException and OtherException. To have the job retry 3 times at most for each exception individually, the following retry_on declarations are necessary: ``` retry_on CustomException, attempts: 3 retry_on OtherException, attempts: 3 ```
* Keep executions for each specific exception (#34352)Alberto Almagro2018-11-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Keep executions for each specific declaration Fixes #34337 ActiveJob used the global executions counter to control the number of times a job should be retried. The problem with this approach was that in case a job raised different exceptions during its executions they weren't retried the number of times defined by their `attemps` number. **Example:** Having the following job: ```ruby class BuggyJob < ActiveJob::Base retry_on CustomException, attemps: 3 retry_on OtherException, attempts: 3 end ``` If the job raised `CustomException` in the first two executions and then it raised `OtherException`, the job wasn't retried anymore because the global executions counter was already indicating 3 attempts. With this patch each `retry_on` declaration has its specific counter so that the first two executions that raise `CustomException` don't affect the retries count that future exceptions may have. * Revert "clarifies documentation around the attempts arugment to retry_on" This reverts commit 86aa8f8c5631f77ed9a208e5107003c01512133e.
* Increment execution count before deserialize argumentsyuuji.yaginuma2018-08-181-0/+1
| | | | | | | | Currently, the execution count increments after deserializes arguments. Therefore, if an error occurs with deserialize, it retries indefinitely. In order to prevent this, the count is moved before deserialize. Fixes #33344.
* Allow passing multiple exceptions to retry_on/discard_onGeorge Claghorn2018-06-251-0/+7
|
* Rename exception variable to error.Kasper Timm Hansen2018-05-211-2/+2
| | | | Follows the change from 6fac9bd, so the naming is consistent.
* Pass the error instance as the second parameter of block executed by ↵yuuji.yaginuma2018-05-121-1/+1
| | | | | | | | | | | `discard_on` I'm not sure what originally wanted to pass to the argument. However, as long as see the document added along with the commit, it seems just to be mistaken that trying to pass the error instance. https://github.com/rails/rails/pull/30622/files#diff-59beb0189c8c6bc862edf7fdb84ff5a7R64 Fixes #32853
* Merge branch 'master' into custom-discarded-job-handlingAidan Haran2017-12-091-1/+1
|\
| * Test exception message to ensure an exception instance is yieldedKazunori Kajihiro2017-10-131-1/+1
| |
* | Allow for custom handling of exceptions that are discardedAidan Haran2017-09-161-0/+2
|/
* [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveJobKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Yield the job instance so you have access to things like `job.arguments` on ↵David Heinemeier Hansson2016-08-161-1/+1
| | | | the custom logic after retries fail
* applies new string literal convention in activejob/testXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix tests against ActiveSupport::DurationsDavid Heinemeier Hansson2016-08-021-0/+2
|
* Allow for custom handling of exceptions that persist beyond the retry attemptsDavid Heinemeier Hansson2016-08-011-0/+2
|
* Add exponentially_longer and custom wait algorithmsDavid Heinemeier Hansson2016-08-011-0/+4
|
* Use descriptive exception namesDavid Heinemeier Hansson2016-08-011-6/+6
|
* Add retry_on/discard_on for better exception handlingDavid Heinemeier Hansson2016-07-291-0/+21