activejob 7.2.2.2 → 8.0.3
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 -59
- data/README.md +1 -1
- data/lib/active_job/base.rb +2 -2
- data/lib/active_job/configured_job.rb +0 -4
- data/lib/active_job/core.rb +11 -3
- data/lib/active_job/enqueue_after_transaction_commit.rb +18 -2
- data/lib/active_job/enqueuing.rb +3 -4
- data/lib/active_job/exceptions.rb +2 -1
- data/lib/active_job/gem_version.rb +4 -4
- data/lib/active_job/log_subscriber.rb +8 -4
- data/lib/active_job/queue_adapter.rb +1 -0
- data/lib/active_job/queue_adapters/abstract_adapter.rb +0 -8
- data/lib/active_job/queue_adapters/async_adapter.rb +1 -1
- data/lib/active_job/queue_adapters/delayed_job_adapter.rb +0 -8
- data/lib/active_job/queue_adapters/inline_adapter.rb +0 -4
- data/lib/active_job/queue_adapters/queue_classic_adapter.rb +0 -8
- data/lib/active_job/queue_adapters/sucker_punch_adapter.rb +7 -0
- data/lib/active_job/queue_adapters/test_adapter.rb +1 -9
- data/lib/active_job/queue_adapters.rb +0 -3
- data/lib/active_job/railtie.rb +21 -3
- data/lib/active_job/serializers.rb +0 -2
- data/lib/active_job.rb +0 -12
- 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: cd83b074127046f406525380f3021fae2cd3ddb36ce9ae8ef44768e63a315b39
|
|
4
|
+
data.tar.gz: 6df6eb7459e16314d5819aac1966f9ecf596ed17c5590d4229b92de444f70d4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d59029dbd69e9b803af9319161888de3569574b6105e0550bda39f0632b7686f97fbac1c0f4694c00b7e9d76bc17f70570a88e7262ae1c5a6864d810fbce02e8
|
|
7
|
+
data.tar.gz: c7ac883680b1cbe1f7da6b6aa9243ae33dbed2c296ebdaba279349af6f87fe6b9fbf148923f849e578deb76fe4804d401c632bbaac2860f0cbd6bbe458fc90c4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,97 +1,66 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Rails 7.2.2.1 (December 10, 2024) ##
|
|
7
|
-
|
|
8
|
-
* No changes.
|
|
3
|
+
* Include the actual Active Job locale when serializing rather than I18n locale.
|
|
9
4
|
|
|
5
|
+
*Adrien S*
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
* Fix `retry_job` instrumentation when using `:test` adapter for Active Job.
|
|
12
8
|
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Rails 7.2.1.2 (October 23, 2024) ##
|
|
17
|
-
|
|
18
|
-
* No changes.
|
|
9
|
+
*fatkodima*
|
|
19
10
|
|
|
20
11
|
|
|
21
|
-
## Rails
|
|
12
|
+
## Rails 8.0.2.1 (August 13, 2025) ##
|
|
22
13
|
|
|
23
14
|
* No changes.
|
|
24
15
|
|
|
25
16
|
|
|
26
|
-
## Rails
|
|
17
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
|
27
18
|
|
|
28
19
|
* No changes.
|
|
29
20
|
|
|
30
21
|
|
|
31
|
-
## Rails
|
|
22
|
+
## Rails 8.0.1 (December 13, 2024) ##
|
|
32
23
|
|
|
33
|
-
*
|
|
24
|
+
* Avoid crashing in Active Job logger when logging enqueueing errors
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
across all tests. In some tests your adapter would be used, but other tests would use the `TestAdapter`.
|
|
26
|
+
`ActiveJob.perform_all_later` could fail with a `TypeError` when all
|
|
27
|
+
provided jobs failed to be enqueueed.
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
the `TestAdapter` will continue to be used.
|
|
29
|
+
*Efstathios Stivaros*
|
|
41
30
|
|
|
42
|
-
See [#48585](https://github.com/rails/rails/pull/48585) for more details.
|
|
43
31
|
|
|
44
|
-
|
|
32
|
+
## Rails 8.0.0.1 (December 10, 2024) ##
|
|
45
33
|
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
A common mistake with Active Job is to enqueue jobs from inside a transaction,
|
|
49
|
-
causing them to potentially be picked and ran by another process, before the
|
|
50
|
-
transaction is committed, which may result in various errors.
|
|
51
|
-
|
|
52
|
-
```ruby
|
|
53
|
-
Topic.transaction do
|
|
54
|
-
topic = Topic.create(...)
|
|
55
|
-
NewTopicNotificationJob.perform_later(topic)
|
|
56
|
-
end
|
|
57
|
-
```
|
|
34
|
+
* No changes.
|
|
58
35
|
|
|
59
|
-
Now Active Job will automatically defer the enqueuing to after the transaction is committed,
|
|
60
|
-
and drop the job if the transaction is rolled back.
|
|
61
36
|
|
|
62
|
-
|
|
63
|
-
or force it on a per job basis:
|
|
37
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
class NewTopicNotificationJob < ApplicationJob
|
|
67
|
-
self.enqueue_after_transaction_commit = :never # or `:always` or `:default`
|
|
68
|
-
end
|
|
69
|
-
```
|
|
39
|
+
* No changes.
|
|
70
40
|
|
|
71
|
-
*Jean Boussier*, *Cristian Bica*
|
|
72
41
|
|
|
73
|
-
|
|
42
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
|
74
43
|
|
|
75
|
-
|
|
44
|
+
* No changes.
|
|
76
45
|
|
|
77
|
-
* Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
|
|
78
46
|
|
|
79
|
-
|
|
47
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
|
80
48
|
|
|
81
|
-
* Remove deprecated
|
|
49
|
+
* Remove deprecated `config.active_job.use_big_decimal_serializer`.
|
|
82
50
|
|
|
83
51
|
*Rafael Mendonça França*
|
|
84
52
|
|
|
85
|
-
* Remove deprecated support to set numeric values to `scheduled_at` attribute.
|
|
86
53
|
|
|
87
|
-
|
|
54
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
|
88
55
|
|
|
89
|
-
* Deprecate `
|
|
56
|
+
* Deprecate `sucker_punch` as an adapter option.
|
|
90
57
|
|
|
91
|
-
|
|
58
|
+
If you're using this adapter, change to `adapter: async` for the same functionality.
|
|
92
59
|
|
|
93
|
-
*
|
|
60
|
+
*Dino Maric, zzak*
|
|
94
61
|
|
|
95
|
-
|
|
62
|
+
* Use `RAILS_MAX_THREADS` in `ActiveJob::AsyncAdapter`. If it is not set, use 5 as default.
|
|
63
|
+
|
|
64
|
+
*heka1024*
|
|
96
65
|
|
|
97
|
-
Please check [7-
|
|
66
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/activejob/CHANGELOG.md) for previous changes.
|
data/README.md
CHANGED
|
@@ -126,6 +126,6 @@ Bug reports for the Ruby on \Rails project can be filed here:
|
|
|
126
126
|
|
|
127
127
|
* https://github.com/rails/rails/issues
|
|
128
128
|
|
|
129
|
-
Feature requests should be discussed on the
|
|
129
|
+
Feature requests should be discussed on the rubyonrails-core forum here:
|
|
130
130
|
|
|
131
131
|
* https://discuss.rubyonrails.org/c/rubyonrails-core
|
data/lib/active_job/base.rb
CHANGED
|
@@ -40,7 +40,7 @@ module ActiveJob # :nodoc:
|
|
|
40
40
|
# end
|
|
41
41
|
#
|
|
42
42
|
# Records that are passed in are serialized/deserialized using Global
|
|
43
|
-
# ID. More information can be found in Arguments.
|
|
43
|
+
# ID. More information can be found in ActiveJob::Arguments.
|
|
44
44
|
#
|
|
45
45
|
# To enqueue a job to be performed as soon as the queuing system is free:
|
|
46
46
|
#
|
|
@@ -50,7 +50,7 @@ module ActiveJob # :nodoc:
|
|
|
50
50
|
#
|
|
51
51
|
# ProcessPhotoJob.set(wait_until: Date.tomorrow.noon).perform_later(photo)
|
|
52
52
|
#
|
|
53
|
-
# More information can be found in ActiveJob::Core::ClassMethods#set
|
|
53
|
+
# More information can be found in ActiveJob::Core::ClassMethods#set.
|
|
54
54
|
#
|
|
55
55
|
# A job can also be processed immediately without sending to the queue:
|
|
56
56
|
#
|
data/lib/active_job/core.rb
CHANGED
|
@@ -114,7 +114,7 @@ module ActiveJob
|
|
|
114
114
|
"arguments" => serialize_arguments_if_needed(arguments),
|
|
115
115
|
"executions" => executions,
|
|
116
116
|
"exception_executions" => exception_executions,
|
|
117
|
-
"locale" => I18n.locale.to_s,
|
|
117
|
+
"locale" => locale || I18n.locale.to_s,
|
|
118
118
|
"timezone" => timezone,
|
|
119
119
|
"enqueued_at" => Time.now.utc.iso8601(9),
|
|
120
120
|
"scheduled_at" => scheduled_at ? scheduled_at.utc.iso8601(9) : nil,
|
|
@@ -157,8 +157,8 @@ module ActiveJob
|
|
|
157
157
|
self.exception_executions = job_data["exception_executions"]
|
|
158
158
|
self.locale = job_data["locale"] || I18n.locale.to_s
|
|
159
159
|
self.timezone = job_data["timezone"] || Time.zone&.name
|
|
160
|
-
self.enqueued_at =
|
|
161
|
-
self.scheduled_at =
|
|
160
|
+
self.enqueued_at = deserialize_time(job_data["enqueued_at"]) if job_data["enqueued_at"]
|
|
161
|
+
self.scheduled_at = deserialize_time(job_data["scheduled_at"]) if job_data["scheduled_at"]
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
# Configures the job with the given options.
|
|
@@ -198,5 +198,13 @@ module ActiveJob
|
|
|
198
198
|
def arguments_serialized?
|
|
199
199
|
@serialized_arguments
|
|
200
200
|
end
|
|
201
|
+
|
|
202
|
+
def deserialize_time(time)
|
|
203
|
+
if time.is_a?(Time)
|
|
204
|
+
time
|
|
205
|
+
else
|
|
206
|
+
Time.iso8601(time)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
201
209
|
end
|
|
202
210
|
end
|
|
@@ -4,13 +4,29 @@ module ActiveJob
|
|
|
4
4
|
module EnqueueAfterTransactionCommit # :nodoc:
|
|
5
5
|
private
|
|
6
6
|
def raw_enqueue
|
|
7
|
+
enqueue_after_transaction_commit = self.class.enqueue_after_transaction_commit
|
|
8
|
+
|
|
7
9
|
after_transaction = case self.class.enqueue_after_transaction_commit
|
|
8
10
|
when :always
|
|
11
|
+
ActiveJob.deprecator.warn(<<~MSG.squish)
|
|
12
|
+
Setting `#{self.class.name}.enqueue_after_transaction_commit = :always` is deprecated and will be removed in Rails 8.1.
|
|
13
|
+
Set to `true` to always enqueue the job after the transaction is committed.
|
|
14
|
+
MSG
|
|
9
15
|
true
|
|
10
16
|
when :never
|
|
17
|
+
ActiveJob.deprecator.warn(<<~MSG.squish)
|
|
18
|
+
Setting `#{self.class.name}.enqueue_after_transaction_commit = :never` is deprecated and will be removed in Rails 8.1.
|
|
19
|
+
Set to `false` to never enqueue the job after the transaction is committed.
|
|
20
|
+
MSG
|
|
21
|
+
false
|
|
22
|
+
when :default
|
|
23
|
+
ActiveJob.deprecator.warn(<<~MSG.squish)
|
|
24
|
+
Setting `#{self.class.name}.enqueue_after_transaction_commit = :default` is deprecated and will be removed in Rails 8.1.
|
|
25
|
+
Set to `false` to never enqueue the job after the transaction is committed.
|
|
26
|
+
MSG
|
|
11
27
|
false
|
|
12
|
-
else
|
|
13
|
-
|
|
28
|
+
else
|
|
29
|
+
enqueue_after_transaction_commit
|
|
14
30
|
end
|
|
15
31
|
|
|
16
32
|
if after_transaction
|
data/lib/active_job/enqueuing.rb
CHANGED
|
@@ -48,10 +48,9 @@ module ActiveJob
|
|
|
48
48
|
# automatically defers the enqueue to after the transaction commits.
|
|
49
49
|
#
|
|
50
50
|
# It can be set on a per job basis:
|
|
51
|
-
# -
|
|
52
|
-
# -
|
|
53
|
-
|
|
54
|
-
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: :never
|
|
51
|
+
# - true forces the job to be deferred.
|
|
52
|
+
# - false forces the job to be queued immediately.
|
|
53
|
+
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: false
|
|
55
54
|
end
|
|
56
55
|
|
|
57
56
|
# Includes the +perform_later+ method for job initialization.
|
|
@@ -50,7 +50,7 @@ module ActiveJob
|
|
|
50
50
|
info do
|
|
51
51
|
jobs = event.payload[:jobs]
|
|
52
52
|
adapter = event.payload[:adapter]
|
|
53
|
-
enqueued_count = event.payload[:enqueued_count]
|
|
53
|
+
enqueued_count = event.payload[:enqueued_count].to_i
|
|
54
54
|
|
|
55
55
|
if enqueued_count == jobs.size
|
|
56
56
|
enqueued_jobs_message(adapter, jobs)
|
|
@@ -189,15 +189,19 @@ module ActiveJob
|
|
|
189
189
|
end
|
|
190
190
|
|
|
191
191
|
def log_enqueue_source
|
|
192
|
-
source =
|
|
192
|
+
source = enqueue_source_location
|
|
193
193
|
|
|
194
194
|
if source
|
|
195
195
|
logger.info("↳ #{source}")
|
|
196
196
|
end
|
|
197
197
|
end
|
|
198
198
|
|
|
199
|
-
def
|
|
200
|
-
|
|
199
|
+
def enqueue_source_location
|
|
200
|
+
Thread.each_caller_location do |location|
|
|
201
|
+
frame = backtrace_cleaner.clean_frame(location)
|
|
202
|
+
return frame if frame
|
|
203
|
+
end
|
|
204
|
+
nil
|
|
201
205
|
end
|
|
202
206
|
|
|
203
207
|
def enqueued_jobs_message(adapter, enqueued_jobs)
|
|
@@ -50,6 +50,7 @@ module ActiveJob
|
|
|
50
50
|
case name_or_adapter
|
|
51
51
|
when Symbol, String
|
|
52
52
|
queue_adapter = ActiveJob::QueueAdapters.lookup(name_or_adapter).new
|
|
53
|
+
queue_adapter.try(:check_adapter)
|
|
53
54
|
assign_adapter(name_or_adapter.to_s, queue_adapter)
|
|
54
55
|
else
|
|
55
56
|
if queue_adapter?(name_or_adapter)
|
|
@@ -7,14 +7,6 @@ module ActiveJob
|
|
|
7
7
|
# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter
|
|
8
8
|
# forms the abstraction layer which makes this possible.
|
|
9
9
|
class AbstractAdapter
|
|
10
|
-
# Defines whether enqueuing should happen implicitly to after commit when called
|
|
11
|
-
# from inside a transaction. Most adapters should return true, but some adapters
|
|
12
|
-
# that use the same database as Active Record and are transaction aware can return
|
|
13
|
-
# false to continue enqueuing jobs as part of the transaction.
|
|
14
|
-
def enqueue_after_transaction_commit?
|
|
15
|
-
true
|
|
16
|
-
end
|
|
17
|
-
|
|
18
10
|
def enqueue(job)
|
|
19
11
|
raise NotImplementedError
|
|
20
12
|
end
|
|
@@ -74,7 +74,7 @@ module ActiveJob
|
|
|
74
74
|
class Scheduler # :nodoc:
|
|
75
75
|
DEFAULT_EXECUTOR_OPTIONS = {
|
|
76
76
|
min_threads: 0,
|
|
77
|
-
max_threads:
|
|
77
|
+
max_threads: ENV.fetch("RAILS_MAX_THREADS", 5).to_i,
|
|
78
78
|
auto_terminate: true,
|
|
79
79
|
idletime: 60, # 1 minute
|
|
80
80
|
max_queue: 0, # unlimited
|
|
@@ -16,14 +16,6 @@ module ActiveJob
|
|
|
16
16
|
#
|
|
17
17
|
# Rails.application.config.active_job.queue_adapter = :delayed_job
|
|
18
18
|
class DelayedJobAdapter < AbstractAdapter
|
|
19
|
-
def initialize(enqueue_after_transaction_commit: false)
|
|
20
|
-
@enqueue_after_transaction_commit = enqueue_after_transaction_commit
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def enqueue_after_transaction_commit? # :nodoc:
|
|
24
|
-
@enqueue_after_transaction_commit
|
|
25
|
-
end
|
|
26
|
-
|
|
27
19
|
def enqueue(job) # :nodoc:
|
|
28
20
|
delayed_job = Delayed::Job.enqueue(JobWrapper.new(job.serialize), queue: job.queue_name, priority: job.priority)
|
|
29
21
|
job.provider_job_id = delayed_job.id
|
|
@@ -11,10 +11,6 @@ module ActiveJob
|
|
|
11
11
|
#
|
|
12
12
|
# Rails.application.config.active_job.queue_adapter = :inline
|
|
13
13
|
class InlineAdapter < AbstractAdapter
|
|
14
|
-
def enqueue_after_transaction_commit? # :nodoc:
|
|
15
|
-
false
|
|
16
|
-
end
|
|
17
|
-
|
|
18
14
|
def enqueue(job) # :nodoc:
|
|
19
15
|
Base.execute(job.serialize)
|
|
20
16
|
end
|
|
@@ -19,14 +19,6 @@ module ActiveJob
|
|
|
19
19
|
#
|
|
20
20
|
# Rails.application.config.active_job.queue_adapter = :queue_classic
|
|
21
21
|
class QueueClassicAdapter < AbstractAdapter
|
|
22
|
-
def initialize(enqueue_after_transaction_commit: false)
|
|
23
|
-
@enqueue_after_transaction_commit = enqueue_after_transaction_commit
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def enqueue_after_transaction_commit? # :nodoc:
|
|
27
|
-
@enqueue_after_transaction_commit
|
|
28
|
-
end
|
|
29
|
-
|
|
30
22
|
def enqueue(job) # :nodoc:
|
|
31
23
|
qc_job = build_queue(job.queue_name).enqueue("#{JobWrapper.name}.perform", job.serialize)
|
|
32
24
|
job.provider_job_id = qc_job["id"] if qc_job.is_a?(Hash)
|
|
@@ -18,6 +18,13 @@ module ActiveJob
|
|
|
18
18
|
#
|
|
19
19
|
# Rails.application.config.active_job.queue_adapter = :sucker_punch
|
|
20
20
|
class SuckerPunchAdapter < AbstractAdapter
|
|
21
|
+
def check_adapter
|
|
22
|
+
ActiveJob.deprecator.warn <<~MSG.squish
|
|
23
|
+
The `sucker_punch` adapter is deprecated and will be removed in Rails 8.1.
|
|
24
|
+
Please use the `async` adapter instead.
|
|
25
|
+
MSG
|
|
26
|
+
end
|
|
27
|
+
|
|
21
28
|
def enqueue(job) # :nodoc:
|
|
22
29
|
if JobWrapper.respond_to?(:perform_async)
|
|
23
30
|
# sucker_punch 2.0 API
|
|
@@ -12,17 +12,9 @@ module ActiveJob
|
|
|
12
12
|
#
|
|
13
13
|
# Rails.application.config.active_job.queue_adapter = :test
|
|
14
14
|
class TestAdapter < AbstractAdapter
|
|
15
|
-
attr_accessor(:perform_enqueued_jobs, :perform_enqueued_at_jobs, :filter, :reject, :queue, :at
|
|
15
|
+
attr_accessor(:perform_enqueued_jobs, :perform_enqueued_at_jobs, :filter, :reject, :queue, :at)
|
|
16
16
|
attr_writer(:enqueued_jobs, :performed_jobs)
|
|
17
17
|
|
|
18
|
-
def initialize(enqueue_after_transaction_commit: true)
|
|
19
|
-
@enqueue_after_transaction_commit = enqueue_after_transaction_commit
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def enqueue_after_transaction_commit? # :nodoc:
|
|
23
|
-
@enqueue_after_transaction_commit
|
|
24
|
-
end
|
|
25
|
-
|
|
26
18
|
# Provides a store of all the enqueued jobs with the TestAdapter so you can check them.
|
|
27
19
|
def enqueued_jobs
|
|
28
20
|
@enqueued_jobs ||= []
|
|
@@ -12,7 +12,6 @@ module ActiveJob
|
|
|
12
12
|
# * {Resque}[https://github.com/resque/resque]
|
|
13
13
|
# * {Sidekiq}[https://sidekiq.org]
|
|
14
14
|
# * {Sneakers}[https://github.com/jondot/sneakers]
|
|
15
|
-
# * {Sucker Punch}[https://github.com/brandonhilkert/sucker_punch]
|
|
16
15
|
# * Please Note: We are not accepting pull requests for new adapters. See the {README}[link:files/activejob/README_md.html] for more details.
|
|
17
16
|
#
|
|
18
17
|
# For testing and development Active Job has three built-in adapters:
|
|
@@ -32,7 +31,6 @@ module ActiveJob
|
|
|
32
31
|
# | Resque | Yes | Yes | Yes (Gem) | Queue | Global | Yes |
|
|
33
32
|
# | Sidekiq | Yes | Yes | Yes | Queue | No | Job |
|
|
34
33
|
# | Sneakers | Yes | Yes | No | Queue | Queue | No |
|
|
35
|
-
# | Sucker Punch | Yes | Yes | Yes | No | No | No |
|
|
36
34
|
# | Active Job Async | Yes | Yes | Yes | No | No | No |
|
|
37
35
|
# | Active Job Inline | No | Yes | N/A | N/A | N/A | N/A |
|
|
38
36
|
# | Active Job Test | No | Yes | N/A | N/A | N/A | N/A |
|
|
@@ -119,7 +117,6 @@ module ActiveJob
|
|
|
119
117
|
autoload :InlineAdapter
|
|
120
118
|
autoload :BackburnerAdapter
|
|
121
119
|
autoload :DelayedJobAdapter
|
|
122
|
-
autoload :QueAdapter
|
|
123
120
|
autoload :QueueClassicAdapter
|
|
124
121
|
autoload :ResqueAdapter
|
|
125
122
|
autoload :SidekiqAdapter
|
data/lib/active_job/railtie.rb
CHANGED
|
@@ -31,7 +31,22 @@ module ActiveJob
|
|
|
31
31
|
ActiveJob::Base.include EnqueueAfterTransactionCommit
|
|
32
32
|
|
|
33
33
|
if app.config.active_job.key?(:enqueue_after_transaction_commit)
|
|
34
|
-
ActiveJob
|
|
34
|
+
ActiveJob.deprecator.warn(<<~MSG.squish)
|
|
35
|
+
`config.active_job.enqueue_after_transaction_commit` is deprecated and will be removed in Rails 8.1.
|
|
36
|
+
This configuration can still be set on individual jobs using `self.enqueue_after_transaction_commit=`,
|
|
37
|
+
but due the nature of this behavior, it is not recommended to be set globally.
|
|
38
|
+
MSG
|
|
39
|
+
|
|
40
|
+
value = case app.config.active_job.enqueue_after_transaction_commit
|
|
41
|
+
when :always
|
|
42
|
+
true
|
|
43
|
+
when :never
|
|
44
|
+
false
|
|
45
|
+
else
|
|
46
|
+
false
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
ActiveJob::Base.enqueue_after_transaction_commit = value
|
|
35
50
|
end
|
|
36
51
|
end
|
|
37
52
|
end
|
|
@@ -54,7 +69,8 @@ module ActiveJob
|
|
|
54
69
|
# Configs used in other initializers
|
|
55
70
|
options = options.except(
|
|
56
71
|
:log_query_tags_around_perform,
|
|
57
|
-
:custom_serializers
|
|
72
|
+
:custom_serializers,
|
|
73
|
+
:enqueue_after_transaction_commit
|
|
58
74
|
)
|
|
59
75
|
|
|
60
76
|
options.each do |k, v|
|
|
@@ -91,7 +107,9 @@ module ActiveJob
|
|
|
91
107
|
app.config.active_record.query_log_tags |= [:job]
|
|
92
108
|
|
|
93
109
|
ActiveSupport.on_load(:active_record) do
|
|
94
|
-
ActiveRecord::QueryLogs.taggings
|
|
110
|
+
ActiveRecord::QueryLogs.taggings = ActiveRecord::QueryLogs.taggings.merge(
|
|
111
|
+
job: ->(context) { context[:job].class.name if context[:job] }
|
|
112
|
+
)
|
|
95
113
|
end
|
|
96
114
|
end
|
|
97
115
|
end
|
data/lib/active_job.rb
CHANGED
|
@@ -49,18 +49,6 @@ module ActiveJob
|
|
|
49
49
|
autoload :TestCase
|
|
50
50
|
autoload :TestHelper
|
|
51
51
|
|
|
52
|
-
def self.use_big_decimal_serializer
|
|
53
|
-
ActiveJob.deprecator.warn <<-WARNING.squish
|
|
54
|
-
Rails.application.config.active_job.use_big_decimal_serializer is deprecated and will be removed in Rails 8.0.
|
|
55
|
-
WARNING
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def self.use_big_decimal_serializer=(value)
|
|
59
|
-
ActiveJob.deprecator.warn <<-WARNING.squish
|
|
60
|
-
Rails.application.config.active_job.use_big_decimal_serializer is deprecated and will be removed in Rails 8.0.
|
|
61
|
-
WARNING
|
|
62
|
-
end
|
|
63
|
-
|
|
64
52
|
##
|
|
65
53
|
# :singleton-method: verbose_enqueue_logs
|
|
66
54
|
#
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activejob
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 8.0.3
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 8.0.3
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: globalid
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -103,10 +103,10 @@ licenses:
|
|
|
103
103
|
- MIT
|
|
104
104
|
metadata:
|
|
105
105
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
106
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
|
107
|
-
documentation_uri: https://api.rubyonrails.org/
|
|
106
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.3/activejob/CHANGELOG.md
|
|
107
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.3/
|
|
108
108
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
109
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
|
109
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.3/activejob
|
|
110
110
|
rubygems_mfa_required: 'true'
|
|
111
111
|
rdoc_options: []
|
|
112
112
|
require_paths:
|
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
115
|
requirements:
|
|
116
116
|
- - ">="
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 3.
|
|
118
|
+
version: 3.2.0
|
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - ">="
|