faktory_worker_ruby 2.1.1 → 2.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8df3ceda59c66e2bcb7d04f70fec7de89e6a6219f9159420a9500df7c8a0d35b
4
- data.tar.gz: 258295f65b955167b9d89f66aada3b28675368d835362edef694bd50b10f57cd
3
+ metadata.gz: 5bc50e5880ae9251f03af00d572ba2f8ede535c8b32dc46a78f575b2b029d928
4
+ data.tar.gz: 4af492a8da94673d2be33ef8bbae0f6fedbe88586ffcd4fb3b0b1e1c259a179f
5
5
  SHA512:
6
- metadata.gz: 0b02206889ca2ff8b57f3de485a880904b9eb8e422975e78ed23176e753b4cc5ce7d4eca76f65f7f9b0c49c0440503892e26cdc9f960d170a076f8d49570a4d1
7
- data.tar.gz: 7e7065afe15d6308245131ab4524fd5d2accdf51590817c91cd83beededd356a3bc4e0132cfc42f1eeb2bfc13bb367eecf8087f6c225d4a939d2f05828709662
6
+ metadata.gz: 920a1448f12e688036b9282e1e7e3971de3a0bd6db99a28b0f160a1e41bf86c79b4f579a3e5e2fe08d437a7a9f42bf3933cb683f9d011a673f4d06c2e97a2d91
7
+ data.tar.gz: dd0b203e37eace0dc4949b056932e2ba24b55502349bf29c4df584309833828d27206fb33bdcec7a73eb2cad4132a6e87926bc3bc992cd3a2a053bb7a97794bd
@@ -11,7 +11,7 @@ jobs:
11
11
  strategy:
12
12
  fail-fast: false
13
13
  matrix:
14
- ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
14
+ ruby: ["3.2", "3.3", "3.4"]
15
15
  runs-on: ubuntu-latest
16
16
  services:
17
17
  faktory:
@@ -20,7 +20,7 @@ jobs:
20
20
  - 7419:7419
21
21
  - 7420:7420
22
22
  steps:
23
- - uses: actions/checkout@v2
23
+ - uses: actions/checkout@v6
24
24
  - uses: ruby/setup-ruby@v1
25
25
  with:
26
26
  bundler-cache: true
data/Changes.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2.1.2
4
+
5
+ - Fix race condition in `faktory_options`. [#523]
6
+
3
7
  ## 2.1.1
4
8
 
5
9
  - Add new `Faktory::Client#queue_latency` API
data/Gemfile.lock CHANGED
@@ -1,57 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faktory_worker_ruby (2.1.0)
4
+ faktory_worker_ruby (2.1.2)
5
5
  connection_pool (~> 2.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activejob (8.0.2)
11
- activesupport (= 8.0.2)
10
+ activejob (8.1.2)
11
+ activesupport (= 8.1.2)
12
12
  globalid (>= 0.3.6)
13
- activesupport (8.0.2)
13
+ activesupport (8.1.2)
14
14
  base64
15
- benchmark (>= 0.3)
16
15
  bigdecimal
17
16
  concurrent-ruby (~> 1.0, >= 1.3.1)
18
17
  connection_pool (>= 2.2.5)
19
18
  drb
20
19
  i18n (>= 1.6, < 2)
20
+ json
21
21
  logger (>= 1.4.2)
22
22
  minitest (>= 5.1)
23
23
  securerandom (>= 0.3)
24
24
  tzinfo (~> 2.0, >= 2.0.5)
25
25
  uri (>= 0.13.1)
26
26
  ast (2.4.3)
27
- base64 (0.2.0)
28
- benchmark (0.4.0)
29
- bigdecimal (3.1.9)
30
- concurrent-ruby (1.3.5)
31
- connection_pool (2.5.3)
27
+ base64 (0.3.0)
28
+ bigdecimal (4.0.1)
29
+ concurrent-ruby (1.3.6)
30
+ connection_pool (2.5.5)
32
31
  docile (1.4.1)
33
- drb (2.2.1)
34
- globalid (1.2.1)
32
+ drb (2.2.3)
33
+ globalid (1.3.0)
35
34
  activesupport (>= 6.1)
36
- i18n (1.14.7)
35
+ i18n (1.14.8)
37
36
  concurrent-ruby (~> 1.0)
38
- json (2.11.3)
39
- language_server-protocol (3.17.0.4)
37
+ json (2.18.0)
38
+ language_server-protocol (3.17.0.5)
40
39
  lint_roller (1.1.0)
41
40
  logger (1.7.0)
42
- minitest (5.25.5)
43
- minitest-hooks (1.5.2)
41
+ minitest (5.27.0)
42
+ minitest-hooks (1.5.3)
44
43
  minitest (> 5.3)
45
44
  parallel (1.27.0)
46
- parser (3.3.8.0)
45
+ parser (3.3.10.1)
47
46
  ast (~> 2.4.1)
48
47
  racc
49
- prism (1.4.0)
48
+ prism (1.8.0)
50
49
  racc (1.8.1)
51
50
  rainbow (3.1.1)
52
- rake (13.2.1)
53
- regexp_parser (2.10.0)
54
- rubocop (1.75.5)
51
+ rake (13.3.1)
52
+ regexp_parser (2.11.3)
53
+ rubocop (1.82.1)
55
54
  json (~> 2.3)
56
55
  language_server-protocol (~> 3.17.0.2)
57
56
  lint_roller (~> 1.1.0)
@@ -59,48 +58,48 @@ GEM
59
58
  parser (>= 3.3.0.2)
60
59
  rainbow (>= 2.2.2, < 4.0)
61
60
  regexp_parser (>= 2.9.3, < 3.0)
62
- rubocop-ast (>= 1.44.0, < 2.0)
61
+ rubocop-ast (>= 1.48.0, < 2.0)
63
62
  ruby-progressbar (~> 1.7)
64
63
  unicode-display_width (>= 2.4.0, < 4.0)
65
- rubocop-ast (1.44.1)
64
+ rubocop-ast (1.49.0)
66
65
  parser (>= 3.3.7.2)
67
- prism (~> 1.4)
68
- rubocop-performance (1.25.0)
66
+ prism (~> 1.7)
67
+ rubocop-performance (1.26.1)
69
68
  lint_roller (~> 1.1)
70
69
  rubocop (>= 1.75.0, < 2.0)
71
- rubocop-ast (>= 1.38.0, < 2.0)
70
+ rubocop-ast (>= 1.47.1, < 2.0)
72
71
  ruby-progressbar (1.13.0)
73
72
  securerandom (0.4.1)
74
73
  simplecov (0.22.0)
75
74
  docile (~> 1.1)
76
75
  simplecov-html (~> 0.11)
77
76
  simplecov_json_formatter (~> 0.1)
78
- simplecov-html (0.13.1)
77
+ simplecov-html (0.13.2)
79
78
  simplecov_json_formatter (0.1.4)
80
- standard (1.49.0)
79
+ standard (1.53.0)
81
80
  language_server-protocol (~> 3.17.0.2)
82
81
  lint_roller (~> 1.0)
83
- rubocop (~> 1.75.2)
82
+ rubocop (~> 1.82.0)
84
83
  standard-custom (~> 1.0.0)
85
84
  standard-performance (~> 1.8)
86
85
  standard-custom (1.0.2)
87
86
  lint_roller (~> 1.0)
88
87
  rubocop (~> 1.50)
89
- standard-performance (1.8.0)
88
+ standard-performance (1.9.0)
90
89
  lint_roller (~> 1.1)
91
- rubocop-performance (~> 1.25.0)
90
+ rubocop-performance (~> 1.26.0)
92
91
  tzinfo (2.0.6)
93
92
  concurrent-ruby (~> 1.0)
94
- unicode-display_width (3.1.4)
95
- unicode-emoji (~> 4.0, >= 4.0.4)
96
- unicode-emoji (4.0.4)
97
- uri (1.0.3)
93
+ unicode-display_width (3.2.0)
94
+ unicode-emoji (~> 4.1)
95
+ unicode-emoji (4.2.0)
96
+ uri (1.1.1)
98
97
 
99
98
  PLATFORMS
100
99
  ruby
101
100
 
102
101
  DEPENDENCIES
103
- activejob
102
+ activejob (>= 7.0.0, >= 0)
104
103
  faktory_worker_ruby!
105
104
  minitest (~> 5)
106
105
  minitest-hooks
@@ -109,4 +108,4 @@ DEPENDENCIES
109
108
  standard
110
109
 
111
110
  BUNDLED WITH
112
- 2.4.22
111
+ 4.0.4
data/lib/faktory/job.rb CHANGED
@@ -122,6 +122,8 @@ module Faktory
122
122
  end
123
123
 
124
124
  module ClassMethods
125
+ ACCESSOR_MUTEX = Mutex.new
126
+
125
127
  def set(options)
126
128
  opts = get_faktory_options.dup
127
129
  opts["jobtype"] = self
@@ -162,10 +164,18 @@ module Faktory
162
164
  instance_writer = true
163
165
 
164
166
  attrs.each do |name|
167
+ synchronized_getter = "__synchronized_#{name}"
168
+
165
169
  singleton_class.instance_eval do
166
170
  undef_method(name) if method_defined?(name) || private_method_defined?(name)
167
171
  end
168
- define_singleton_method(name) { nil }
172
+
173
+ define_singleton_method(synchronized_getter) { nil }
174
+ singleton_class.class_eval do
175
+ private(synchronized_getter)
176
+ end
177
+
178
+ define_singleton_method(name) { ACCESSOR_MUTEX.synchronize { send synchronized_getter } }
169
179
 
170
180
  ivar = "@#{name}"
171
181
 
@@ -175,8 +185,10 @@ module Faktory
175
185
  end
176
186
  define_singleton_method(:"#{name}=") do |val|
177
187
  singleton_class.class_eval do
178
- undef_method(name) if method_defined?(name) || private_method_defined?(name)
179
- define_method(name) { val }
188
+ ACCESSOR_MUTEX.synchronize do
189
+ undef_method(synchronized_getter) if method_defined?(synchronized_getter) || private_method_defined?(synchronized_getter)
190
+ define_method(synchronized_getter) { val }
191
+ end
180
192
  end
181
193
 
182
194
  if singleton_class?
@@ -67,6 +67,7 @@ module Faktory
67
67
  module Middleware
68
68
  class Chain
69
69
  include Enumerable
70
+
70
71
  attr_reader :entries
71
72
 
72
73
  def initialize_copy(copy)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faktory
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faktory_worker_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: connection_pool
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.6.2
149
+ rubygems_version: 4.0.4
150
150
  specification_version: 4
151
151
  summary: Ruby worker for Faktory
152
152
  test_files: []