Akira Matsuda
726b71cbb2
No need to nodoc private methods
2016-12-24 21:16:13 +09:00
Akira Matsuda
7269d9de6a
Privatize unneededly protected methods in Active Job tests
2016-12-24 00:15:18 +09:00
Kir Shatrov
2f421fa294
Remove warning in ActiveJob
...
Currently it causes:
```
activejob/Rakefile:5: warning: already initialized constant ACTIVEJOB_ADAPTERS
```
2016-12-21 20:38:12 -05:00
utilum
893069fa02
Output adapter being tested.
2016-12-12 21:52:04 +01:00
Matthew Draper
0e97cd1a0d
Avoid race condition in AJ integration tests
...
Make sure the file doesn't exist until we've finished writing it.
2016-11-30 21:10:52 +10:30
yuuji.yaginuma
5b825c55fe
remove Ruby warning from Active Job test helper methods
...
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
```
2016-11-18 18:20:48 +09:00
Maxime Boisvert
c061236cc7
Use named parameters instead of assert_valid_keys
2016-11-16 17:19:48 -05:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces
2016-10-29 01:17:49 -02:00
Xavier Noria
7506f33906
removes requires already present in active_support/rails
2016-10-27 09:45:20 +02:00
Gabi Stefanini
393f25bdba
Uses queue adapter_method instead of ActiveJob::Base.queue_adapter
...
Change ActiveJob::Base.queue_adapter to use queue_adapter method to make test code consistent.
2016-10-24 22:25:48 -04:00
Gabi Stefanini
0d454d0806
Add examples of queue_adapter and perform_enqueued jobs to API Docs.
2016-10-21 11:59:01 -04:00
yuuji.yaginuma
77bdbb5f41
add missing closing tag [ci skip]
2016-10-14 09:15:51 +09:00
Rafael Mendonça França
d1fc0a5eb2
Removed deprecated support to passing the adapter class to .queue_adapter
2016-10-10 15:00:28 -03:00
Rafael Mendonça França
d861a1fcf8
Removed deprecated #original_exception in ActiveJob::DeserializationError
2016-10-10 14:55:20 -03:00
Jon Moss
743dba533e
Merge pull request #26740 from y-yagi/update_retry_on_example
...
correct exception class in `retry_on` example [ci skip]
2016-10-08 19:51:42 -04:00
yuuji.yaginuma
be199dfae2
correct exception class in retry_on
example [ci skip]
...
If the deadlock has occurred `ActiveRecord::Deadlocked` will raise.
Ref: #25107 , #26059
2016-10-09 08:46:31 +09:00
Matthew Draper
cb0452e9a5
Fixnum and Bignum are deprecated in Ruby trunk
...
https://bugs.ruby-lang.org/issues/12739
2016-10-08 08:13:11 +10:30
yuuji.yaginuma
6a8e7fd8d8
fix link to resque
[ci skip]
...
`1-x-stable` branch does not exist, `master` is 1.x branch.
Ref: http://words.steveklabnik.com/rescuing-resque-again
2016-09-20 08:56:05 +09:00
yuuji.yaginuma
0b2197774c
use descendants
to get class that inherited ActiveJob::Base
...
`subclasses` get only child classes.
Therefore, if create a job common parent class as `ApplicationJob`,
inherited class does not get properly.
2016-09-05 09:21:10 +09:00
Xavier Noria
bb1ecdcc67
fixes remaining RuboCop issues [Vipul A M, Xavier Noria]
2016-09-01 23:41:49 +02:00
Rafael Mendonça França
0510208dd1
Add load hooks to all tests classes
...
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.
2016-08-25 04:22:48 -03:00
Rafael Mendonça França
7f4b16ed83
Merge pull request #26205 from pedaling-corp/fix/active-job-resque
...
Add @queue variable to JobWrapper
2016-08-23 00:39:39 -03:00
yuuji.yaginuma
88f9a1540a
correct exception class in retry_on
example [ci skip]
...
If the deadlock has occurred `ActiveRecord::Deadlocked` will raise.
Ref: #25107 , #26059
2016-08-20 17:21:14 +09:00
InJung Chung
9f6461a28c
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.
2016-08-19 17:10:27 +09:00
David Heinemeier Hansson
a1e4c197cb
Yield the job instance so you have access to things like job.arguments
on the custom logic after retries fail
2016-08-16 16:01:59 -07:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
...
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Vipul A M
8b984161d6
Pass over changelogs [ci skip]
2016-08-10 09:33:13 +05:30
Xavier Noria
a9dc45459a
code gardening: removes redundant selfs
...
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.
2016-08-08 01:12:38 +02:00
Ryuta Kamizono
762e3f05f3
Add Style/EmptyLines
in .rubocop.yml
and remove extra empty lines
2016-08-07 17:50:59 +09:00
Xavier Noria
b326e82dc0
applies remaining conventions across the project
2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9
normalizes indentation and whitespace across the project
2016-08-06 20:16:27 +02:00
Xavier Noria
411ccbdab2
remove redundant curlies from hash arguments
2016-08-06 19:44:11 +02:00
Xavier Noria
301ce2a6d1
modernizes hash syntax in activejob
2016-08-06 19:36:54 +02:00
Xavier Noria
e6ab70c439
applies new string literal convention to the rest of the project
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:28:46 +02:00
Xavier Noria
adca8154c6
applies new string literal convention in the gemspecs
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:27:12 +02:00
Xavier Noria
bde6547bb6
applies new string literal convention in activejob/test
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:41:18 +02:00
Xavier Noria
93c9534c98
applies new string literal convention in activejob/lib
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:40:07 +02:00
David Heinemeier Hansson
01a69e27a4
Offer invitations to use retry_on/discard_on for common cases
2016-08-04 14:57:10 -07:00
David Heinemeier Hansson
4f5a9890b7
Guard against jobs that were persisted before we started counting executions by zeroing out nil counters
2016-08-03 14:30:39 -07:00
David Heinemeier Hansson
b53da9e90b
Amend the CHANGELOG
2016-08-02 15:04:45 -07:00
David Heinemeier Hansson
7efd77fae5
Fix tests against ActiveSupport::Durations
2016-08-02 14:27:01 -07:00
David Heinemeier Hansson
111227c0df
Please Rubocup
2016-08-02 12:28:16 -07:00
David Heinemeier Hansson
3118911335
Not needed
2016-08-01 20:29:29 -07:00
David Heinemeier Hansson
9d8d4ee05e
Allow for custom handling of exceptions that persist beyond the retry attempts
2016-08-01 16:51:11 -07:00
David Heinemeier Hansson
0be5d5d4c4
Add exponentially_longer and custom wait algorithms
2016-08-01 16:44:29 -07:00
David Heinemeier Hansson
08a92d47b0
Use descriptive exception names
2016-08-01 16:09:16 -07:00
David Heinemeier Hansson
a4fc7dc957
Executions counting is not a serialization concern
...
Let’s do it when we actually execute instead. Then the tests dealing
with comparable serializations won’t fail either!
2016-08-01 16:02:50 -07:00
David Heinemeier Hansson
779148d390
Reraise instead of swallow exceptions that occur beyond the retry attempts
2016-07-29 15:15:31 -07:00
David Heinemeier Hansson
f931290e58
Proper logging when we bail on retrying after X attempts
2016-07-29 15:07:50 -07:00
David Heinemeier Hansson
8457e5eb1d
Allow retries to happen with different priority and queue
2016-07-29 14:23:39 -07:00