activejob 7.0.2.3 → 7.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/lib/active_job/arguments.rb +2 -1
- data/lib/active_job/callbacks.rb +0 -1
- data/lib/active_job/enqueuing.rb +1 -1
- data/lib/active_job/gem_version.rb +3 -3
- data/lib/active_job/queue_adapters/que_adapter.rb +28 -6
- data/lib/active_job/queue_adapters/test_adapter.rb +2 -2
- data/lib/active_job/test_helper.rb +7 -7
- data/lib/active_job/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 619c392b3b1934bf8928a00e6a3ccc7489d892a6e14789c532163656878ee46b
|
4
|
+
data.tar.gz: 9e2b6ef26f6da87c576e02fc63331afc17ff74771dbe3c72e1b653852cca24d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37154184efe19657d6994393ff0750c8507386d9620ac4afbe7551727dbe2f8f882bac214d01d99e993733fa94a0fd1250fdcb0a58cd43fd8cf73d5fb0ea9aab
|
7
|
+
data.tar.gz: 7225a316b52bb1c4b576ee98049aba194e5f1601047cb4b25531b5fcfbbc1f94600d9ff1ae4f642756b9bd501b06ee2c5f78e6f61a41dc08c95200013930b366
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
2
|
+
|
3
|
+
* Update `ActiveJob::QueueAdapters::QueAdapter` to remove deprecation warning.
|
4
|
+
|
5
|
+
Remove a deprecation warning introduced in que 1.2 to prepare for changes in
|
6
|
+
que 2.0 necessary for Ruby 3 compatibility.
|
7
|
+
|
8
|
+
*Damir Zekic* and *Adis Hasovic*
|
9
|
+
|
10
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
11
|
+
|
12
|
+
* No changes.
|
13
|
+
|
14
|
+
|
15
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
16
|
+
|
17
|
+
* Add missing `bigdecimal` require in `ActiveJob::Arguments`
|
18
|
+
|
19
|
+
Could cause `uninitialized constant ActiveJob::Arguments::BigDecimal (NameError)`
|
20
|
+
when loading Active Job in isolation.
|
21
|
+
|
22
|
+
*Jean Boussier*
|
23
|
+
|
24
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
25
|
+
|
26
|
+
* No changes.
|
27
|
+
|
28
|
+
|
1
29
|
## Rails 7.0.2.3 (March 08, 2022) ##
|
2
30
|
|
3
31
|
* No changes.
|
data/lib/active_job/arguments.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "bigdecimal"
|
3
4
|
require "active_support/core_ext/hash"
|
4
5
|
|
5
6
|
module ActiveJob
|
@@ -17,7 +18,7 @@ module ActiveJob
|
|
17
18
|
# currently support String, Integer, Float, NilClass, TrueClass, FalseClass,
|
18
19
|
# BigDecimal, Symbol, Date, Time, DateTime, ActiveSupport::TimeWithZone,
|
19
20
|
# ActiveSupport::Duration, Hash, ActiveSupport::HashWithIndifferentAccess,
|
20
|
-
# Array, Range or GlobalID::Identification instances, although this can be
|
21
|
+
# Array, Range, or GlobalID::Identification instances, although this can be
|
21
22
|
# extended by adding custom serializers.
|
22
23
|
# Raised if you set the key for a Hash something else than a string or
|
23
24
|
# a symbol. Also raised when trying to serialize an object which can't be
|
data/lib/active_job/callbacks.rb
CHANGED
@@ -28,7 +28,6 @@ module ActiveJob
|
|
28
28
|
end
|
29
29
|
|
30
30
|
included do
|
31
|
-
class_attribute :return_false_on_aborted_enqueue, instance_accessor: false, instance_predicate: false, default: false
|
32
31
|
cattr_accessor :skip_after_callbacks_if_terminated, instance_accessor: false, default: false
|
33
32
|
singleton_class.deprecate :skip_after_callbacks_if_terminated, :skip_after_callbacks_if_terminated=
|
34
33
|
|
data/lib/active_job/enqueuing.rb
CHANGED
@@ -17,7 +17,7 @@ module ActiveJob
|
|
17
17
|
# Push a job onto the queue. By default the arguments must be either String,
|
18
18
|
# Integer, Float, NilClass, TrueClass, FalseClass, BigDecimal, Symbol, Date,
|
19
19
|
# Time, DateTime, ActiveSupport::TimeWithZone, ActiveSupport::Duration,
|
20
|
-
# Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range or
|
20
|
+
# Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range, or
|
21
21
|
# GlobalID::Identification instances, although this can be extended by adding
|
22
22
|
# custom serializers.
|
23
23
|
#
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ActiveJob
|
4
|
-
# Returns the version of
|
4
|
+
# Returns the currently loaded version of Active Job as a <tt>Gem::Version</tt>.
|
5
5
|
def self.gem_version
|
6
6
|
Gem::Version.new VERSION::STRING
|
7
7
|
end
|
@@ -9,8 +9,8 @@ module ActiveJob
|
|
9
9
|
module VERSION
|
10
10
|
MAJOR = 7
|
11
11
|
MINOR = 0
|
12
|
-
TINY =
|
13
|
-
PRE =
|
12
|
+
TINY = 4
|
13
|
+
PRE = nil
|
14
14
|
|
15
15
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
16
16
|
end
|
@@ -18,22 +18,44 @@ module ActiveJob
|
|
18
18
|
# Rails.application.config.active_job.queue_adapter = :que
|
19
19
|
class QueAdapter
|
20
20
|
def enqueue(job) # :nodoc:
|
21
|
-
|
21
|
+
job_options = { priority: job.priority, queue: job.queue_name }
|
22
|
+
que_job = nil
|
23
|
+
|
24
|
+
if require_job_options_kwarg?
|
25
|
+
que_job = JobWrapper.enqueue job.serialize, job_options: job_options
|
26
|
+
else
|
27
|
+
que_job = JobWrapper.enqueue job.serialize, **job_options
|
28
|
+
end
|
29
|
+
|
22
30
|
job.provider_job_id = que_job.attrs["job_id"]
|
23
31
|
que_job
|
24
32
|
end
|
25
33
|
|
26
34
|
def enqueue_at(job, timestamp) # :nodoc:
|
27
|
-
|
35
|
+
job_options = { priority: job.priority, queue: job.queue_name, run_at: Time.at(timestamp) }
|
36
|
+
que_job = nil
|
37
|
+
|
38
|
+
if require_job_options_kwarg?
|
39
|
+
que_job = JobWrapper.enqueue job.serialize, job_options: job_options
|
40
|
+
else
|
41
|
+
que_job = JobWrapper.enqueue job.serialize, **job_options
|
42
|
+
end
|
43
|
+
|
28
44
|
job.provider_job_id = que_job.attrs["job_id"]
|
29
45
|
que_job
|
30
46
|
end
|
31
47
|
|
32
|
-
|
33
|
-
def
|
34
|
-
|
48
|
+
private
|
49
|
+
def require_job_options_kwarg?
|
50
|
+
@require_job_options_kwarg ||=
|
51
|
+
JobWrapper.method(:enqueue).parameters.any? { |ptype, pname| ptype == :key && pname == :job_options }
|
52
|
+
end
|
53
|
+
|
54
|
+
class JobWrapper < Que::Job # :nodoc:
|
55
|
+
def run(job_data)
|
56
|
+
Base.execute job_data
|
57
|
+
end
|
35
58
|
end
|
36
|
-
end
|
37
59
|
end
|
38
60
|
end
|
39
61
|
end
|
@@ -5,10 +5,10 @@ module ActiveJob
|
|
5
5
|
# == Test adapter for Active Job
|
6
6
|
#
|
7
7
|
# The test adapter should be used only in testing. Along with
|
8
|
-
#
|
8
|
+
# ActiveJob::TestCase and ActiveJob::TestHelper
|
9
9
|
# it makes a great tool to test your Rails application.
|
10
10
|
#
|
11
|
-
# To use the test adapter set queue_adapter config to +:test+.
|
11
|
+
# To use the test adapter set +queue_adapter+ config to +:test+.
|
12
12
|
#
|
13
13
|
# Rails.application.config.active_job.queue_adapter = :test
|
14
14
|
class TestAdapter
|
@@ -57,12 +57,12 @@ module ActiveJob
|
|
57
57
|
# Specifies the queue adapter to use with all Active Job test helpers.
|
58
58
|
#
|
59
59
|
# Returns an instance of the queue adapter and defaults to
|
60
|
-
#
|
60
|
+
# ActiveJob::QueueAdapters::TestAdapter.
|
61
61
|
#
|
62
62
|
# Note: The adapter provided by this method must provide some additional
|
63
|
-
# methods from those expected of a standard
|
63
|
+
# methods from those expected of a standard ActiveJob::QueueAdapter
|
64
64
|
# in order to be used with the active job test helpers. Refer to
|
65
|
-
#
|
65
|
+
# ActiveJob::QueueAdapters::TestAdapter.
|
66
66
|
def queue_adapter_for_test
|
67
67
|
ActiveJob::QueueAdapters::TestAdapter.new
|
68
68
|
end
|
@@ -109,7 +109,7 @@ module ActiveJob
|
|
109
109
|
# end
|
110
110
|
# end
|
111
111
|
#
|
112
|
-
# +:only+ and +:except+ options accept Class, Array of Class or Proc. When passed a Proc,
|
112
|
+
# +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
|
113
113
|
# a hash containing the job's class and it's argument are passed as argument.
|
114
114
|
#
|
115
115
|
# Asserts the number of times a job is enqueued to a specific queue by passing +:queue+ option.
|
@@ -168,7 +168,7 @@ module ActiveJob
|
|
168
168
|
# end
|
169
169
|
# end
|
170
170
|
#
|
171
|
-
# +:only+ and +:except+ options accept Class, Array of Class or Proc. When passed a Proc,
|
171
|
+
# +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
|
172
172
|
# a hash containing the job's class and it's argument are passed as argument.
|
173
173
|
#
|
174
174
|
# Asserts that no jobs are enqueued to a specific queue by passing +:queue+ option
|
@@ -325,7 +325,7 @@ module ActiveJob
|
|
325
325
|
# end
|
326
326
|
# end
|
327
327
|
#
|
328
|
-
# +:only+ and +:except+ options accept Class, Array of Class or Proc. When passed a Proc,
|
328
|
+
# +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
|
329
329
|
# an instance of the job will be passed as argument.
|
330
330
|
#
|
331
331
|
# If the +:queue+ option is specified,
|
@@ -579,7 +579,7 @@ module ActiveJob
|
|
579
579
|
# assert_performed_jobs 1
|
580
580
|
# end
|
581
581
|
#
|
582
|
-
# +:only+ and +:except+ options accept Class, Array of Class or Proc. When passed a Proc,
|
582
|
+
# +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
|
583
583
|
# an instance of the job will be passed as argument.
|
584
584
|
#
|
585
585
|
# If the +:queue+ option is specified,
|
data/lib/active_job/version.rb
CHANGED
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: 7.0.
|
4
|
+
version: 7.0.4
|
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: 2022-
|
11
|
+
date: 2022-09-09 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: 7.0.
|
19
|
+
version: 7.0.4
|
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: 7.0.
|
26
|
+
version: 7.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,10 +100,10 @@ licenses:
|
|
100
100
|
- MIT
|
101
101
|
metadata:
|
102
102
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
103
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
104
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
103
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.4/activejob/CHANGELOG.md
|
104
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.4/
|
105
105
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
106
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
106
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.4/activejob
|
107
107
|
rubygems_mfa_required: 'true'
|
108
108
|
post_install_message:
|
109
109
|
rdoc_options: []
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
123
|
+
rubygems_version: 3.3.3
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Job framework with pluggable queues.
|