aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job
Commit message (Collapse)AuthorAgeFilesLines
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-8/+3
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Removed string inquiry.Mohit Natoo2017-05-261-4/+4
| | | | | | fixed indentation. rebased with master.
* Provides friendlier way to access queue adapters of a job.Mohit Natoo2017-05-261-3/+16
| | | | - removed predicate method. Used only reader.
* Improving docs for callbacks execution order [ci skip]dixpac2017-05-211-1/+3
| | | | | When define callbacks latest definition on the same callback/method overwrites previous ones.
* Add error logging to Active JobSteven Bull2017-03-271-3/+10
| | | | | | | | | | | | | | | | | | | | Active Job logging instrumentation is changed to log errors (with backtrace) when a job raises an exception in #perform. This improves debugging during development and test with the default configuration. Prior to Rails 5, the default development configuration ran jobs with InlineAdapter, which would raise exceptions to the caller and be shown in the development log. In Rails 5, the default adapter was changed to AsyncAdapter, which would silently swallow exceptions and log a "Performed SomeJob from Async..." info message. This could be confusing to a developer, as it would seem that the job was performed successfully. This patch removes the "Performed..." info message from the log and adds an error-level "Error performing SomeJob..." log message which includes the exception backtrace for jobs that raise an exception within the #perform method. It provides this behavior for all adapters.
* Start Rails 5.2 developmentMatthew Draper2017-03-221-2/+2
|
* Revert #27850 following test breakage (#28427)David Heinemeier Hansson2017-03-151-4/+7
|
* Merge pull request #28112 from bolek/include-job_id-in-all-active-job-logsRafael França2017-02-231-2/+2
|\ | | | | Include JobID in all ActiveJob info logs
| * Include JobID in all ActiveJob info logsBolek Kurowski2017-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | Currently we provide the Job ID in logs only related to enqueuing a job. This adds the job id to the remaining ActiveJob logs when: - a job started performing - a job ended performing Providing the job id in those logs will ease searching logs by job id.
* | Preparing for 5.1.0.beta1 releaseRafael Mendonça França2017-02-231-1/+1
|/
* correctly set test adapter when configure the queue adapter on a per job ↵Yuji Yaginuma2017-01-311-10/+35
| | | | | | | | | | | | (#26690) The `ActiveJob::TestHelper` replace the adapter to test adapter in `before_setup`. It gets the target class using the `descendants`, but if the test target job class is not loaded, will not be a replacement of the adapter. Therefore, instead of replacing with `before_setup`, modified to replace when setting adapter. Fixes #26360
* Append skipped jobs to enqueued_jobsAlexander Pauly2017-01-311-7/+3
| | | | | | | | | | Refactored ActiveJob TestAdapter Updated ActiveJob changelog Fixed typo in changelog Fixed formatting issue in changelog
* Merge pull request #27624 from elfassy/assert_enqueued_jobs_with_queue_levelGuillermo Iguaran2017-01-191-10/+24
|\ | | | | Specify the queue to be used with assert_enqueued_jobs
| * assert_enqueued_jobs with queue optionMichael Elfassy2017-01-181-10/+24
| |
* | s/perfomed/performed/Akira Matsuda2017-01-171-1/+1
| | | | | | | | [ci skip]
* | remove unused requireyuuji.yaginuma2017-01-151-1/+0
|/ | | | `InlineAdapter` is not used from 1f8558f.
* Privatize unneededly protected method in Active JobAkira Matsuda2016-12-241-2/+2
|
* No need to nodoc private methodsAkira Matsuda2016-12-241-5/+5
|
* remove Ruby warning from Active Job test helper methodsyuuji.yaginuma2016-11-181-4/+4
| | | | | | | | | This removes the following warnings. ``` /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:241: warning: shadowing outer local variable - job /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:265: warning: shadowing outer local variable - job ```
* Use named parameters instead of `assert_valid_keys`Maxime Boisvert2016-11-161-8/+8
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-298-8/+8
|
* removes requires already present in active_support/railsXavier Noria2016-10-271-1/+0
|
* Add examples of queue_adapter and perform_enqueued jobs to API Docs.Gabi Stefanini2016-10-211-0/+24
|
* add missing closing tag [ci skip]yuuji.yaginuma2016-10-141-1/+1
|
* Removed deprecated support to passing the adapter class to .queue_adapterRafael Mendonça França2016-10-101-10/+0
|
* Removed deprecated #original_exception in ActiveJob::DeserializationErrorRafael Mendonça França2016-10-101-13/+1
|
* Fixnum and Bignum are deprecated in Ruby trunkMatthew Draper2016-10-081-2/+2
| | | | https://bugs.ruby-lang.org/issues/12739
* fix link to `resque` [ci skip]yuuji.yaginuma2016-09-201-1/+1
| | | | | `1-x-stable` branch does not exist, `master` is 1.x branch. Ref: http://words.steveklabnik.com/rescuing-resque-again
* use `descendants` to get class that inherited `ActiveJob::Base`yuuji.yaginuma2016-09-051-1/+1
| | | | | | `subclasses` get only child classes. Therefore, if create a job common parent class as `ApplicationJob`, inherited class does not get properly.
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-011-1/+1
|
* Add load hooks to all tests classesRafael Mendonça França2016-08-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Usually users extends tests classes doing something like: ActionView::TestCase.include MyCustomTestHelpers This is bad because it will load the ActionView::TestCase right aways and this will load ActionController::Base making its on_load hooks to execute early than it should. One way to fix this is using the on_load hooks of the components like: ActiveSupport.on_load(:action_view) do ActionView::TestCase.include MyCustomTestHelpers end The problem with this approach is that the test extension will be only load when ActionView::Base is loaded and this may happen too late in the test. To fix this we are adding hooks to people extend the test classes that will be loaded exactly when the test classes are needed.
* Merge pull request #26205 from pedaling-corp/fix/active-job-resqueRafael Mendonça França2016-08-231-0/+1
|\ | | | | | | Add @queue variable to JobWrapper
| * Added instance variable `@queue` to JobWrapper.InJung Chung2016-08-191-0/+1
| | | | | | | | | | 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.
* | correct exception class in `retry_on` example [ci skip]yuuji.yaginuma2016-08-201-2/+2
|/ | | | | If the deadlock has occurred `ActiveRecord::Deadlocked` will raise. Ref: #25107, #26059
* Yield the job instance so you have access to things like `job.arguments` on ↵David Heinemeier Hansson2016-08-161-3/+3
| | | | the custom logic after retries fail
* Add three new rubocop rulesRafael Mendonça França2016-08-161-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* code gardening: removes redundant selfsXavier Noria2016-08-081-2/+2
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* applies remaining conventions across the projectXavier Noria2016-08-062-2/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-064-86/+86
|
* applies new string literal convention in activejob/libXavier Noria2016-08-0626-88/+88
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Guard against jobs that were persisted before we started counting executions ↵David Heinemeier Hansson2016-08-031-1/+3
| | | | by zeroing out nil counters
* Fix tests against ActiveSupport::DurationsDavid Heinemeier Hansson2016-08-021-4/+9
|
* Please RubocupDavid Heinemeier Hansson2016-08-021-3/+3
|
* Allow for custom handling of exceptions that persist beyond the retry attemptsDavid Heinemeier Hansson2016-08-011-4/+14
|
* Add exponentially_longer and custom wait algorithmsDavid Heinemeier Hansson2016-08-011-3/+25
|
* Executions counting is not a serialization concernDavid Heinemeier Hansson2016-08-012-1/+2
| | | | | Let’s do it when we actually execute instead. Then the tests dealing with comparable serializations won’t fail either!
* Reraise instead of swallow exceptions that occur beyond the retry attemptsDavid Heinemeier Hansson2016-07-291-1/+2
|
* Proper logging when we bail on retrying after X attemptsDavid Heinemeier Hansson2016-07-291-2/+6
|
* Allow retries to happen with different priority and queueDavid Heinemeier Hansson2016-07-291-2/+4
|
* Require time extension for 3.seconds defaultDavid Heinemeier Hansson2016-07-291-0/+2
|