activejob 7.0.3.1 → 7.0.4

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: b52c57ec26b00940ffe64ac85b469cf455d8fec27c3fd2b117497b0109746677
4
- data.tar.gz: 69985eb16b795b0e76a34d2cd6b1903204df79ffc300242936eed6d12ede70cc
3
+ metadata.gz: 619c392b3b1934bf8928a00e6a3ccc7489d892a6e14789c532163656878ee46b
4
+ data.tar.gz: 9e2b6ef26f6da87c576e02fc63331afc17ff74771dbe3c72e1b653852cca24d1
5
5
  SHA512:
6
- metadata.gz: ab63ae1b77d0faed85d5cfcd553b33936d1c7e8aa956ed01968231743e6c6fb23c6bfcdf28616f165bc1a4ac4d6ff51c5175026fd1769d325a549c94a6a5706f
7
- data.tar.gz: c9af2e154d909fa40f41ed9e5a716a1ed2dd297b02b8dbd226e1188da61207b16df94141b8e3c2a30f0c0ecea820119d6dbf4a7256325178936022edfe993f17
6
+ metadata.gz: 37154184efe19657d6994393ff0750c8507386d9620ac4afbe7551727dbe2f8f882bac214d01d99e993733fa94a0fd1250fdcb0a58cd43fd8cf73d5fb0ea9aab
7
+ data.tar.gz: 7225a316b52bb1c4b576ee98049aba194e5f1601047cb4b25531b5fcfbbc1f94600d9ff1ae4f642756b9bd501b06ee2c5f78e6f61a41dc08c95200013930b366
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  ## Rails 7.0.3.1 (July 12, 2022) ##
2
11
 
3
12
  * No changes.
@@ -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
 
@@ -9,8 +9,8 @@ module ActiveJob
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 3
13
- PRE = "1"
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
- que_job = JobWrapper.enqueue job.serialize, priority: job.priority, queue: job.queue_name
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
- que_job = JobWrapper.enqueue job.serialize, priority: job.priority, queue: job.queue_name, run_at: Time.at(timestamp)
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
- class JobWrapper < Que::Job # :nodoc:
33
- def run(job_data)
34
- Base.execute job_data
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
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.3.1
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-07-12 00:00:00.000000000 Z
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.3.1
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.3.1
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.3.1/activejob/CHANGELOG.md
104
- documentation_uri: https://api.rubyonrails.org/v7.0.3.1/
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.3.1/activejob
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: []