activejob 7.2.0.beta3 → 7.2.0
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 +1 -11
- data/lib/active_job/enqueue_after_transaction_commit.rb +0 -16
- data/lib/active_job/enqueuing.rb +14 -0
- data/lib/active_job/gem_version.rb +1 -1
- data/lib/active_job/railtie.rb +4 -6
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61775543f203855f8c8bdec31ddaa7d3c1413aab36a2de5665a726b7f5998307
|
4
|
+
data.tar.gz: 39b14d506be28b9c980fc69ac8910c8e31245aa8e19caa4a15b3511f9d90cac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6351b9fb7e90d452428f30db98315ff523cbd781f409df3fba0ae7241fdedc0ae52514a3d5c4acd01b9474e235844e683a832f6631d65e8ea77b261bea0b3cf9
|
7
|
+
data.tar.gz: 9e18505077f83dd8924cb866138d0809b83fb9df68623f9a5e67cc0dbe1fcdcaea4a59c9de5cd9a4884684a1202b54a8ad0da657f08f5474a6790d20436be130
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,4 @@
|
|
1
|
-
## Rails 7.2.0
|
2
|
-
|
3
|
-
* No changes.
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 7.2.0.beta2 (June 04, 2024) ##
|
7
|
-
|
8
|
-
* No changes.
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 7.2.0.beta1 (May 29, 2024) ##
|
1
|
+
## Rails 7.2.0 (August 09, 2024) ##
|
12
2
|
|
13
3
|
* All tests now respect the `active_job.queue_adapter` config.
|
14
4
|
|
@@ -2,22 +2,6 @@
|
|
2
2
|
|
3
3
|
module ActiveJob
|
4
4
|
module EnqueueAfterTransactionCommit # :nodoc:
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
##
|
9
|
-
# :singleton-method:
|
10
|
-
#
|
11
|
-
# Defines if enqueueing this job from inside an Active Record transaction
|
12
|
-
# automatically defers the enqueue to after the transaction commits.
|
13
|
-
#
|
14
|
-
# It can be set on a per job basis:
|
15
|
-
# - `:always` forces the job to be deferred.
|
16
|
-
# - `:never` forces the job to be queued immediately.
|
17
|
-
# - `:default` lets the queue adapter define the behavior (recommended).
|
18
|
-
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: :never
|
19
|
-
end
|
20
|
-
|
21
5
|
private
|
22
6
|
def raw_enqueue
|
23
7
|
after_transaction = case self.class.enqueue_after_transaction_commit
|
data/lib/active_job/enqueuing.rb
CHANGED
@@ -40,6 +40,20 @@ module ActiveJob
|
|
40
40
|
module Enqueuing
|
41
41
|
extend ActiveSupport::Concern
|
42
42
|
|
43
|
+
included do
|
44
|
+
##
|
45
|
+
# :singleton-method:
|
46
|
+
#
|
47
|
+
# Defines if enqueueing this job from inside an Active Record transaction
|
48
|
+
# automatically defers the enqueue to after the transaction commits.
|
49
|
+
#
|
50
|
+
# It can be set on a per job basis:
|
51
|
+
# - `:always` forces the job to be deferred.
|
52
|
+
# - `:never` forces the job to be queued immediately.
|
53
|
+
# - `:default` lets the queue adapter define the behavior (recommended).
|
54
|
+
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: :never
|
55
|
+
end
|
56
|
+
|
43
57
|
# Includes the +perform_later+ method for job initialization.
|
44
58
|
module ClassMethods
|
45
59
|
# Push a job onto the queue. By default the arguments must be either String,
|
data/lib/active_job/railtie.rb
CHANGED
@@ -26,14 +26,12 @@ module ActiveJob
|
|
26
26
|
end
|
27
27
|
|
28
28
|
initializer "active_job.enqueue_after_transaction_commit" do |app|
|
29
|
-
|
30
|
-
enqueue_after_transaction_commit = config.active_job.delete(:enqueue_after_transaction_commit)
|
31
|
-
|
29
|
+
ActiveSupport.on_load(:active_job) do
|
32
30
|
ActiveSupport.on_load(:active_record) do
|
33
|
-
|
34
|
-
include EnqueueAfterTransactionCommit
|
31
|
+
ActiveJob::Base.include EnqueueAfterTransactionCommit
|
35
32
|
|
36
|
-
|
33
|
+
if app.config.active_job.key?(:enqueue_after_transaction_commit)
|
34
|
+
ActiveJob::Base.enqueue_after_transaction_commit = app.config.active_job.delete(:enqueue_after_transaction_commit)
|
37
35
|
end
|
38
36
|
end
|
39
37
|
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: 7.2.0
|
4
|
+
version: 7.2.0
|
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: 2024-
|
11
|
+
date: 2024-08-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.2.0
|
19
|
+
version: 7.2.0
|
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.2.0
|
26
|
+
version: 7.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,10 +104,10 @@ licenses:
|
|
104
104
|
- MIT
|
105
105
|
metadata:
|
106
106
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
107
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.2.0
|
108
|
-
documentation_uri: https://api.rubyonrails.org/v7.2.0
|
107
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.0/activejob/CHANGELOG.md
|
108
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.0/
|
109
109
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
110
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.2.0
|
110
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.0/activejob
|
111
111
|
rubygems_mfa_required: 'true'
|
112
112
|
post_install_message:
|
113
113
|
rdoc_options: []
|