activejob 5.0.0.1 → 5.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activejob might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/active_job/core.rb +1 -0
- data/lib/active_job/gem_version.rb +2 -2
- data/lib/active_job/queue_adapters/resque_adapter.rb +1 -0
- data/lib/active_job/queue_adapters/sidekiq_adapter.rb +1 -1
- data/lib/active_job/test_case.rb +2 -0
- data/lib/active_job/test_helper.rb +25 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c88dc2a35d24fef3beee52a581f7b06115afa3ff
|
4
|
+
data.tar.gz: e4c8a78a5ba7de441196d36ff1885871c4489aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa3b88ea9bbfb7ab34b6601a60aeac98d3551a0975ada9f35bd330136fa998cdacdbe573507b8ab6f3b097cf2bf64cd2669cefe2aab82b9710e118e40b007d0
|
7
|
+
data.tar.gz: f55b23bcc5abb4adcdcff207664f8f094c9ce667f1e424f443d2861c1cbc32bf502aab2a28e7caa2f17fefd702523862b4cc30238845abcb97e0f9430bbf0d57
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## Rails 5.0.1.rc1 (December 01, 2016) ##
|
2
|
+
|
3
|
+
* Added instance variable `@queue` to JobWrapper.
|
4
|
+
|
5
|
+
This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method,
|
6
|
+
so we can use `#enqueue_delayed_selection`, `#remove_delayed` method in resque-scheduler smoothly.
|
7
|
+
|
8
|
+
*mu29*
|
9
|
+
|
10
|
+
|
1
11
|
## Rails 5.0.0 (June 30, 2016) ##
|
2
12
|
|
3
13
|
* Enable class reloading prior to job dispatch, and ensure Active Record
|
data/README.md
CHANGED
@@ -102,7 +102,7 @@ The latest version of Active Job can be installed with RubyGems:
|
|
102
102
|
|
103
103
|
Source code can be downloaded as part of the Rails project on GitHub
|
104
104
|
|
105
|
-
* https://github.com/rails/rails/tree/
|
105
|
+
* https://github.com/rails/rails/tree/5-0-stable/activejob
|
106
106
|
|
107
107
|
## License
|
108
108
|
|
data/lib/active_job/core.rb
CHANGED
@@ -105,6 +105,7 @@ module ActiveJob
|
|
105
105
|
# end
|
106
106
|
def deserialize(job_data)
|
107
107
|
self.job_id = job_data['job_id']
|
108
|
+
self.provider_job_id = job_data['provider_job_id']
|
108
109
|
self.queue_name = job_data['queue_name']
|
109
110
|
self.priority = job_data['priority']
|
110
111
|
self.serialized_arguments = job_data['arguments']
|
@@ -27,6 +27,7 @@ module ActiveJob
|
|
27
27
|
# Rails.application.config.active_job.queue_adapter = :resque
|
28
28
|
class ResqueAdapter
|
29
29
|
def enqueue(job) #:nodoc:
|
30
|
+
JobWrapper.instance_variable_set(:@queue, job.queue_name)
|
30
31
|
Resque.enqueue_to job.queue_name, JobWrapper, job.serialize
|
31
32
|
end
|
32
33
|
|
data/lib/active_job/test_case.rb
CHANGED
@@ -11,7 +11,7 @@ module ActiveJob
|
|
11
11
|
def before_setup # :nodoc:
|
12
12
|
test_adapter = queue_adapter_for_test
|
13
13
|
|
14
|
-
@old_queue_adapters = (ActiveJob::Base.
|
14
|
+
@old_queue_adapters = (ActiveJob::Base.descendants << ActiveJob::Base).select do |klass|
|
15
15
|
# only override explicitly set adapters, a quirk of `class_attribute`
|
16
16
|
klass.singleton_class.public_instance_methods(false).include?(:_queue_adapter)
|
17
17
|
end.map do |klass|
|
@@ -269,6 +269,25 @@ module ActiveJob
|
|
269
269
|
instantiate_job(matching_job)
|
270
270
|
end
|
271
271
|
|
272
|
+
# Performs all enqueued jobs in the duration of the block.
|
273
|
+
#
|
274
|
+
# def test_perform_enqueued_jobs
|
275
|
+
# perform_enqueued_jobs do
|
276
|
+
# MyJob.perform_later(1, 2, 3)
|
277
|
+
# end
|
278
|
+
# assert_performed_jobs 1
|
279
|
+
# end
|
280
|
+
#
|
281
|
+
# This method also supports filtering. If the +:only+ option is specified,
|
282
|
+
# then only the listed job(s) will be performed.
|
283
|
+
#
|
284
|
+
# def test_perform_enqueued_jobs_with_only
|
285
|
+
# perform_enqueued_jobs(only: MyJob) do
|
286
|
+
# MyJob.perform_later(1, 2, 3) # will be performed
|
287
|
+
# HelloJob.perform_later(1, 2, 3) # will not be perfomed
|
288
|
+
# end
|
289
|
+
# assert_performed_jobs 1
|
290
|
+
# end
|
272
291
|
def perform_enqueued_jobs(only: nil)
|
273
292
|
old_perform_enqueued_jobs = queue_adapter.perform_enqueued_jobs
|
274
293
|
old_perform_enqueued_at_jobs = queue_adapter.perform_enqueued_at_jobs
|
@@ -286,6 +305,11 @@ module ActiveJob
|
|
286
305
|
end
|
287
306
|
end
|
288
307
|
|
308
|
+
# Accesses the queue_adapter set by ActiveJob::Base.
|
309
|
+
#
|
310
|
+
# def test_assert_job_has_custom_queue_adapter_set
|
311
|
+
# assert_instance_of CustomQueueAdapter, HelloJob.queue_adapter
|
312
|
+
# end
|
289
313
|
def queue_adapter
|
290
314
|
ActiveJob::Base.queue_adapter
|
291
315
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.0.
|
19
|
+
version: 5.0.1.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.0.
|
26
|
+
version: 5.0.1.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,14 +96,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: 2.2.2
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - "
|
99
|
+
- - ">"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 1.3.1
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.5.2
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Job framework with pluggable queues.
|
108
108
|
test_files: []
|
109
|
-
has_rdoc:
|