activejob 7.2.1.1 → 8.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3a60bf6940ca6270c614cf3618f9537ee9a082da84e176c00735b040199798e
4
- data.tar.gz: 1c1807cc840a89fe4414a39fc48582d18ed2e46ad89080ca63c508165080d8a0
3
+ metadata.gz: 0fbfb304817561be2dc9669fc234d56cfc38bc25f02134e41299642807b0c997
4
+ data.tar.gz: 791c6aa25026dab8c5c42ce200e843d9e898e8e67fcf8feda11cda9a98c2ad72
5
5
  SHA512:
6
- metadata.gz: ff2f5e989fb6da50b5c504a97d7bbd62caa4a627476702e7bdbc4ae4fc28f664fce0589cf6e317125b9ccf2dc60812de8b076e513dd7131d1a94927eb1ac437d
7
- data.tar.gz: 15c61d32050aac39e081ef4200b798d89abfbb465bcc6fcae5a8dfd0788b8c686ebeec7a486fead2cdafbf96f613d8ec997873fb044d53252b5577a1c5ae6e66
6
+ metadata.gz: 996122b64c9ae05031fea17c63835e42e2b9b97c7918be29676d148c276c9459701d65654111a1d3921b6bc17a2afbe167e87f5cfe6a51eaf3e278bbd94e707f
7
+ data.tar.gz: 499c6a3257207aa90f824edbe5631767c5252d13b063860c00d06bd2440161960c692aeb596df83a3d29609be3a9e1c7c61ebcc881b94fc5983733884d2feb23
data/CHANGELOG.md CHANGED
@@ -1,77 +1,13 @@
1
- ## Rails 7.2.1.1 (October 15, 2024) ##
1
+ ## Rails 8.0.0.beta1 (September 26, 2024) ##
2
2
 
3
- * No changes.
3
+ * Deprecate `sucker_punch` as an adapter option.
4
4
 
5
+ If you're using this adapter, change to `adapter: async` for the same functionality.
5
6
 
6
- ## Rails 7.2.1 (August 22, 2024) ##
7
+ *Dino Maric, zzak*
7
8
 
8
- * No changes.
9
+ * Use `RAILS_MAX_THREADS` in `ActiveJob::AsyncAdapter`. If it is not set, use 5 as default.
9
10
 
11
+ *heka1024*
10
12
 
11
- ## Rails 7.2.0 (August 09, 2024) ##
12
-
13
- * All tests now respect the `active_job.queue_adapter` config.
14
-
15
- Previously if you had set `config.active_job.queue_adapter` in your `config/application.rb`
16
- or `config/environments/test.rb` file, the adapter you selected was previously not used consistently
17
- across all tests. In some tests your adapter would be used, but other tests would use the `TestAdapter`.
18
-
19
- In Rails 7.2, all tests will respect the `queue_adapter` config if provided. If no config is provided,
20
- the `TestAdapter` will continue to be used.
21
-
22
- See [#48585](https://github.com/rails/rails/pull/48585) for more details.
23
-
24
- *Alex Ghiculescu*
25
-
26
- * Make Active Job transaction aware when used conjointly with Active Record.
27
-
28
- A common mistake with Active Job is to enqueue jobs from inside a transaction,
29
- causing them to potentially be picked and ran by another process, before the
30
- transaction is committed, which may result in various errors.
31
-
32
- ```ruby
33
- Topic.transaction do
34
- topic = Topic.create(...)
35
- NewTopicNotificationJob.perform_later(topic)
36
- end
37
- ```
38
-
39
- Now Active Job will automatically defer the enqueuing to after the transaction is committed,
40
- and drop the job if the transaction is rolled back.
41
-
42
- Various queue implementations can choose to disable this behavior, and users can disable it,
43
- or force it on a per job basis:
44
-
45
- ```ruby
46
- class NewTopicNotificationJob < ApplicationJob
47
- self.enqueue_after_transaction_commit = :never # or `:always` or `:default`
48
- end
49
- ```
50
-
51
- *Jean Boussier*, *Cristian Bica*
52
-
53
- * Do not trigger immediate loading of `ActiveJob::Base` when loading `ActiveJob::TestHelper`.
54
-
55
- *Maxime Réty*
56
-
57
- * Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
58
-
59
- *Joshua Young*
60
-
61
- * Remove deprecated `:exponentially_longer` value for the `:wait` in `retry_on`.
62
-
63
- *Rafael Mendonça França*
64
-
65
- * Remove deprecated support to set numeric values to `scheduled_at` attribute.
66
-
67
- *Rafael Mendonça França*
68
-
69
- * Deprecate `Rails.application.config.active_job.use_big_decimal_serialize`.
70
-
71
- *Rafael Mendonça França*
72
-
73
- * Remove deprecated primitive serializer for `BigDecimal` arguments.
74
-
75
- *Rafael Mendonça França*
76
-
77
- Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activejob/CHANGELOG.md) for previous changes.
13
+ Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/activejob/CHANGELOG.md) for previous changes.
@@ -7,10 +7,10 @@ module ActiveJob
7
7
  end
8
8
 
9
9
  module VERSION
10
- MAJOR = 7
11
- MINOR = 2
12
- TINY = 1
13
- PRE = "1"
10
+ MAJOR = 8
11
+ MINOR = 0
12
+ TINY = 0
13
+ PRE = "beta1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -189,15 +189,29 @@ module ActiveJob
189
189
  end
190
190
 
191
191
  def log_enqueue_source
192
- source = extract_enqueue_source_location(caller)
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 extract_enqueue_source_location(locations)
200
- backtrace_cleaner.clean(locations.lazy).first
199
+ if Thread.respond_to?(:each_caller_location)
200
+ def enqueue_source_location
201
+ Thread.each_caller_location do |location|
202
+ frame = backtrace_cleaner.clean_frame(location)
203
+ return frame if frame
204
+ end
205
+ nil
206
+ end
207
+ else
208
+ def enqueue_source_location
209
+ caller_locations(2).each do |location|
210
+ frame = backtrace_cleaner.clean_frame(location)
211
+ return frame if frame
212
+ end
213
+ nil
214
+ end
201
215
  end
202
216
 
203
217
  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)
@@ -74,7 +74,7 @@ module ActiveJob
74
74
  class Scheduler # :nodoc:
75
75
  DEFAULT_EXECUTOR_OPTIONS = {
76
76
  min_threads: 0,
77
- max_threads: Concurrent.processor_count,
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
@@ -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,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
@@ -91,7 +91,9 @@ module ActiveJob
91
91
  app.config.active_record.query_log_tags |= [:job]
92
92
 
93
93
  ActiveSupport.on_load(:active_record) do
94
- ActiveRecord::QueryLogs.taggings[:job] = ->(context) { context[:job].class.name if context[:job] }
94
+ ActiveRecord::QueryLogs.taggings = ActiveRecord::QueryLogs.taggings.merge(
95
+ job: ->(context) { context[:job].class.name if context[:job] }
96
+ )
95
97
  end
96
98
  end
97
99
  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.1.1
4
+ version: 8.0.0.beta1
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-10-15 00:00:00.000000000 Z
11
+ date: 2024-09-26 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.1.1
19
+ version: 8.0.0.beta1
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.1.1
26
+ version: 8.0.0.beta1
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.1.1/activejob/CHANGELOG.md
108
- documentation_uri: https://api.rubyonrails.org/v7.2.1.1/
107
+ changelog_uri: https://github.com/rails/rails/blob/v8.0.0.beta1/activejob/CHANGELOG.md
108
+ documentation_uri: https://api.rubyonrails.org/v8.0.0.beta1/
109
109
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
110
- source_code_uri: https://github.com/rails/rails/tree/v7.2.1.1/activejob
110
+ source_code_uri: https://github.com/rails/rails/tree/v8.0.0.beta1/activejob
111
111
  rubygems_mfa_required: 'true'
112
112
  post_install_message:
113
113
  rdoc_options: []
@@ -117,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 3.1.0
120
+ version: 3.2.0
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="