- 17 8月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 26 7月, 2019 1 次提交
-
-
由 Rafael França 提交于
Ability to test activejobs with relative delay
-
- 23 7月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 25 4月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 23 4月, 2019 1 次提交
-
-
由 John Hawthorn 提交于
Rails 6 introduces retries per-exception, instead of a global count of retries. Because ActiveJob 5.2 doesn't serialize the execution count per-exception, when ActiveJob 6.0 picks up an "old" job it can't know the exception count in the new format. This can also be an issue if AJ 6.0 serializes a new job with exception_executions which is later picked up by AJ 5.2, which would clear exception_executions (since it has no knowledge of it). Previously we handled this by resetting exception_executions, if it wasn't defined on a job, which could result in the worst case retrying the job 2x the times we should. This commit changes how we handle loading a legacy job: instead of resetting exception_executions, we instead will always use the global executions count. This way, jobs which only have one retry_on (and didn't have a behaviour change in AJ 6) are backwards-and-forwards-compatible with counts respected exactly. Jobs with multiple retry_on will revert to the AJ5.2 behaviour if they were ever run under AJ5.2.
-
- 12 4月, 2019 1 次提交
-
-
由 Patrik Bóna 提交于
Individual execution counters were introduced in #34352. However `#determine_delay` which is used to calculate retry delay still uses the global counter. This commit fixes it.
-
- 05 4月, 2019 2 次提交
-
-
由 प्रथमेश Sonpatki 提交于
-
由 Prathamesh Sonpatki 提交于
- It will return false in Rails 6.1 not 6.0. Also fixed the default value which is true for new applications.
-
- 23 3月, 2019 1 次提交
-
-
由 Gannon McGibbon 提交于
-
- 11 3月, 2019 1 次提交
-
-
由 eileencodes 提交于
* Update RAILS_VERSION * Bundle * rake update_versions * rake changelog:header
-
- 09 3月, 2019 1 次提交
-
-
由 Abhay Nikam 提交于
-
- 26 2月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 25 2月, 2019 1 次提交
-
-
由 alkesh26 提交于
-
- 14 2月, 2019 1 次提交
-
-
由 Cory Gwin @gwincr11 提交于
Motivation: - Currently we have 2 seperate monkey patches in place for tracking enqueded time for 2 seperate workers. It seems that activejob could be a source of truth for how long an item has been enqued so that we can easily use it for consistent monitoring across workers/apps to ensure that jobs are running at an acceptable speed. Changes: - Add an enqueded at attribute and serilization tooling. - Add a method to get how long a job has been enqueded for. - Add a logging item to show how long a job was enqued prior to the perform method firing.
-
- 12 2月, 2019 1 次提交
-
-
由 Olivier Lacan 提交于
Currently, we only document the use case for ActiveJob's `queue_as` block arguments in [Rails Guides][1]. It seems necessary to document them in the API docs as well considering how useful and powerful this option is. [1]: https://edgeguides.rubyonrails.org/active_job_basics.html#queues [ci skip]
-
- 29 1月, 2019 1 次提交
-
-
由 alkesh26 提交于
-
- 19 1月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 08 1月, 2019 1 次提交
-
-
由 Rosa Gutierrez 提交于
Some adapters like Resque that use Redis, convert the Ruby hash with a default value, Hash.new(0), into a regular hash without a default value after serializing, storing and deserializing. This raises an error when we try to access a missing exception key. A simple solution is not to rely on the hash's default value, and provide a default as alternative when accessing it instead.
-
- 05 1月, 2019 1 次提交
-
-
由 Rosa Gutierrez 提交于
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 ```
-
- 20 12月, 2018 1 次提交
-
-
由 Ryuta Kamizono 提交于
Since Rails 6 requires Ruby 2.5. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS Follow up #34754.
-
- 06 12月, 2018 1 次提交
-
-
由 Rafael Mendonça França 提交于
And make sure new applications in Rails 6.0 has this config enabled. Also, improve test coverage and add a CHANGELOG entry.
-
- 28 11月, 2018 1 次提交
-
-
由 Rafael Mendonça França 提交于
Trusting any GlobaID object when deserializing jobs can allow attackers to access information that should not be accessible to them. Fix CVE-2018-16476.
-
- 24 11月, 2018 1 次提交
-
-
由 Alberto Almagro 提交于
* 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 86aa8f8c.
-
- 22 11月, 2018 1 次提交
-
-
由 Edouard CHIN 提交于
- That feature is useful to enqueue or assert that jobs got enqueued or performed based on dynamic conditions. We will be able to leverage that feature to fix all ActionMailer assertion helper issue when a Mailer define a custom delivery job (see next commit).
-
- 20 11月, 2018 1 次提交
-
-
由 Bernie Chiu 提交于
-
- 19 11月, 2018 1 次提交
-
-
由 jacobherrington 提交于
My spellchecker flagged this as an incorrect spelling, upon further research it appears to be a point of contention in English. Either way might work. After further examination queuing is much more common in the Rails codebase so making this change will serve to standardize the spelling.
-
- 13 11月, 2018 1 次提交
-
-
由 Alberto Almagro 提交于
The constant `PERMITTED_TYPES` is only used by the private method `serialize_argument` and it already has the `# :nodoc:` annotation as the other constants in the class. Complements e899e228
-
- 12 11月, 2018 1 次提交
-
-
由 Alberto Almagro 提交于
This commit adds missing types to the supported types list, which was extended in #30941
-
- 09 11月, 2018 1 次提交
-
- 04 11月, 2018 1 次提交
-
-
由 Daniel Colson 提交于
Fixes #34366 Currently setting queue_name_prefix will not combine a prefix with the default_queue_name; it will only affect queue names set with `queue_as`. With this PR the prefix will affect the default_queue_name as well. Closes #19831 Currently setting default_queue_name doesn't actually affect the queue_name default (although default_queue_name does get used if you pass a falsey `part_name` to `queue_as`). This PR would get default_queue_name working as expected as well. Because the queue_name default is now a lambda wrapping the default_queue_name, rather than the default_queue_name itself, I had to update one test to use the instance method `#queue_name` (which `instance_exec`s the value) instead of the class method. I think this change is OK, since only the instance method is documented. There was a question about whether we want a `default_queue_name` configuration. If we want to get rid of it, I would also be happy to open a PR for that instead. It has been around for a while now, but it also hasn't really worked for a while now. r? @matthewd since you had an opinion about this before
-
- 31 10月, 2018 1 次提交
-
-
由 Gannon McGibbon 提交于
Restore HashWithIndifferentAccess support to ActiveJob::Arguments.deserialize.
-
- 29 10月, 2018 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 16 10月, 2018 1 次提交
-
-
由 bogdanvlviv 提交于
I found a few sentences that should be updated as well. See https://github.com/rails/rails/pull/33571#discussion_r209435886 Follow up #33571
-
- 13 10月, 2018 1 次提交
-
-
由 Alan Wu 提交于
`assert_enqueued_with` and `assert_performed_with` return a instantiated instance of the matching job for further assertion (#21010). Before this commit the `arguments` method on the returned instance returns a serialized version of the arguments.
-
- 11 10月, 2018 1 次提交
-
-
由 Orhan Toy 提交于
-
- 06 10月, 2018 1 次提交
-
-
由 Alan Wu 提交于
Using `included` to define `attr_acessor` and `attr_writer` is causing these methods to not show up in the documentation.
-
- 29 9月, 2018 2 次提交
-
-
由 Yasuo Honda 提交于
Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
-
由 Mohit Natoo 提交于
* Documentation clarity in ActiveJob::TestHelper [ci skip] * Documentation for options [Mohit Natoo + Rafael Mendonça França]
-
- 27 9月, 2018 1 次提交
-
-
由 Edouard CHIN 提交于
- When calling `assert_performed_with`/`assert_enqueued_with`, the +args+ needs to match exactly what the job get passed. Some jobs can have lot of arguments, or even a simple hash argument has many key. This is not convenient to test as most tests doesn't need to check if the arguments matches perfectly. This PR make it possible to only check if a subset of arguments were passed to the job.
-
- 25 9月, 2018 1 次提交
-
-
由 bogdanvlviv 提交于
Since #33751 was added `enqueue_retry.active_job` instrumentation to the `retry_on` method, then #33897 moved the instrumentation to `retry_job` method in order to ensure that this method publish `enqueue_retry.active_job` notification too. See related discussion https://github.com/rails/rails/pull/33751#discussion_r214140008 Since `enqueue_retry.active_job` moved to `retry_job`, there is no guarantee that payload of `enqueue_retry.active_job` would have `:error`. See test `LoggingTest#test_enqueue_retry_logging_on_retry_job` as example of that case. Related to https://github.com/rails/rails/pull/33897#discussion_r219707024 I think we can improve notification of `enqueue_retry.active_job`: - If there is no `event.payload[:error]`, then publish like "Retrying RescueJob in 3 seconds." only. - If `event.payload[:wait]` is `nil`, then publish "Retrying RescueJob in 0 seconds." instead of "Retrying RescueJob in nil seconds." - If there is `event.payload[:error]`, then publish "Retrying RescueJob in 3 seconds, due to a DefaultsError.". - Change the type of the message from `error` to `info.` Also, this commit removes part of messages - "The original exception was #{ex.cause.inspect}." of `enqueue_retry.active_job`, `retry_stopped.active_job`, and `discard.active_job` since I haven't found it useful. Please let me know whether you agree with that?
-