sidekiq 7.1.5 → 7.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes.md +7 -0
- data/lib/sidekiq/client.rb +2 -2
- data/lib/sidekiq/config.rb +6 -1
- data/lib/sidekiq/testing.rb +18 -5
- data/lib/sidekiq/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50ab03f32263dd24ee37ce2ddadc7a4e5e226860146c1a677262dd3a417329d
|
4
|
+
data.tar.gz: 0af1051781796465d5ce5dd0d0e454016fdc04b7cb5fcf0b8d62e447faff11ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e84e49ceb024e8cb24a7213ffe81e40ed9423d646e39778ed51049bf89a04c28890a21e93eeb38bb9daefe88b94b150d71a0cdf80ecdad712a2167dd0a3421
|
7
|
+
data.tar.gz: 39ffc3e4eee3e2c27a3f774f2a2120c50a52ab9e2049b0fc925123c622553bf4fd19512c16e63882031909bba6ea5b2d15cf856256a3c453d080e89253196fc6
|
data/Changes.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
[Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
|
4
4
|
|
5
|
+
7.1.6
|
6
|
+
----------
|
7
|
+
|
8
|
+
- The block forms of testing modes (inline, fake) are now thread-safe so you can have
|
9
|
+
a multithreaded test suite which uses different modes for different tests. [#6069]
|
10
|
+
- Fix breakage with non-Proc error handlers [#6065]
|
11
|
+
|
5
12
|
7.1.5
|
6
13
|
----------
|
7
14
|
|
data/lib/sidekiq/client.rb
CHANGED
@@ -74,7 +74,7 @@ module Sidekiq
|
|
74
74
|
#
|
75
75
|
# Any options valid for a job class's sidekiq_options are also available here.
|
76
76
|
#
|
77
|
-
# All
|
77
|
+
# All keys must be strings, not symbols. NB: because we are serializing to JSON, all
|
78
78
|
# symbols in 'args' will be converted to strings. Note that +backtrace: true+ can take quite a bit of
|
79
79
|
# space in Redis; a large volume of failing jobs can start Redis swapping if you aren't careful.
|
80
80
|
#
|
@@ -111,7 +111,7 @@ module Sidekiq
|
|
111
111
|
# prevented a job push.
|
112
112
|
#
|
113
113
|
# Example (pushing jobs in batches):
|
114
|
-
# push_bulk('class' =>
|
114
|
+
# push_bulk('class' => MyJob, 'args' => (1..100_000).to_a, batch_size: 1_000)
|
115
115
|
#
|
116
116
|
def push_bulk(items)
|
117
117
|
batch_size = items.delete(:batch_size) || items.delete("batch_size") || 1_000
|
data/lib/sidekiq/config.rb
CHANGED
@@ -258,13 +258,18 @@ module Sidekiq
|
|
258
258
|
@logger = logger
|
259
259
|
end
|
260
260
|
|
261
|
+
private def arity(handler)
|
262
|
+
return handler.arity if handler.is_a?(Proc)
|
263
|
+
handler.method(:call).arity
|
264
|
+
end
|
265
|
+
|
261
266
|
# INTERNAL USE ONLY
|
262
267
|
def handle_exception(ex, ctx = {})
|
263
268
|
if @options[:error_handlers].size == 0
|
264
269
|
p ["!!!!!", ex]
|
265
270
|
end
|
266
271
|
@options[:error_handlers].each do |handler|
|
267
|
-
if handler
|
272
|
+
if arity(handler) == 2
|
268
273
|
# TODO Remove in 8.0
|
269
274
|
logger.info { "DEPRECATION: Sidekiq exception handlers now take three arguments, see #{handler}" }
|
270
275
|
handler.call(ex, {_config: self}.merge(ctx))
|
data/lib/sidekiq/testing.rb
CHANGED
@@ -6,22 +6,35 @@ require "sidekiq"
|
|
6
6
|
module Sidekiq
|
7
7
|
class Testing
|
8
8
|
class << self
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :__global_test_mode
|
10
10
|
|
11
|
+
# Calling without a block sets the global test mode, affecting
|
12
|
+
# all threads. Calling with a block only affects the current Thread.
|
11
13
|
def __set_test_mode(mode)
|
12
14
|
if block_given?
|
13
|
-
current_mode = __test_mode
|
14
15
|
begin
|
15
|
-
self.
|
16
|
+
self.__local_test_mode = mode
|
16
17
|
yield
|
17
18
|
ensure
|
18
|
-
self.
|
19
|
+
self.__local_test_mode = nil
|
19
20
|
end
|
20
21
|
else
|
21
|
-
self.
|
22
|
+
self.__global_test_mode = mode
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
26
|
+
def __test_mode
|
27
|
+
__local_test_mode || __global_test_mode
|
28
|
+
end
|
29
|
+
|
30
|
+
def __local_test_mode
|
31
|
+
Thread.current[:__sidekiq_test_mode]
|
32
|
+
end
|
33
|
+
|
34
|
+
def __local_test_mode=(value)
|
35
|
+
Thread.current[:__sidekiq_test_mode] = value
|
36
|
+
end
|
37
|
+
|
25
38
|
def disable!(&block)
|
26
39
|
__set_test_mode(:disable, &block)
|
27
40
|
end
|
data/lib/sidekiq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
- !ruby/object:Gem::Version
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
|
-
rubygems_version: 3.4.
|
226
|
+
rubygems_version: 3.4.20
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: Simple, efficient background processing for Ruby
|