sidekiq 7.0.5 → 7.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/sidekiq/job_util.rb +23 -37
- 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: fce9a2bde54477663fcf80408ba57e3653b7cabad880d442a931f92725c1ee3c
|
4
|
+
data.tar.gz: 5f3d322fa77edd6dc83e00f5f3c5c1d2e275830065e4637b778e726f2a08c608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801864880ce896e750649e489d9b0f23e04a0c55ca1f3b3d13282dc71aa495cb7937027843321e10a02027d9316c7bb4f6399b1a58c4a1f66a1a4ca85440d66e
|
7
|
+
data.tar.gz: dcab086da52aca3518371632fc92dd469d22266f4b0728ec44ae5c42fbdbfe49485ed0c9244d8d0252b7203ef618304832cf8fb0d1bd95d0368f78bbbd10b7ca
|
data/lib/sidekiq/job_util.rb
CHANGED
@@ -21,8 +21,7 @@ module Sidekiq
|
|
21
21
|
mode = Sidekiq::Config::DEFAULTS[:on_complex_arguments]
|
22
22
|
|
23
23
|
if mode == :raise || mode == :warn
|
24
|
-
|
25
|
-
unsafe_item = json_unsafe_item(args)
|
24
|
+
if (unsafe_item = json_unsafe?(args))
|
26
25
|
msg = <<~EOM
|
27
26
|
Job arguments to #{job_class} must be native JSON types, but #{unsafe_item.inspect} is a #{unsafe_item.class}.
|
28
27
|
See https://github.com/sidekiq/sidekiq/wiki/Best-Practices.
|
@@ -70,50 +69,37 @@ module Sidekiq
|
|
70
69
|
|
71
70
|
private
|
72
71
|
|
73
|
-
|
74
|
-
Integer => ->(val) {
|
75
|
-
Float => ->(val) {
|
76
|
-
TrueClass => ->(val) {
|
77
|
-
FalseClass => ->(val) {
|
78
|
-
NilClass => ->(val) {
|
79
|
-
String => ->(val) {
|
72
|
+
RECURSIVE_JSON_UNSAFE = {
|
73
|
+
Integer => ->(val) {},
|
74
|
+
Float => ->(val) {},
|
75
|
+
TrueClass => ->(val) {},
|
76
|
+
FalseClass => ->(val) {},
|
77
|
+
NilClass => ->(val) {},
|
78
|
+
String => ->(val) {},
|
80
79
|
Array => ->(val) {
|
81
|
-
val.
|
82
|
-
|
83
|
-
Hash => ->(val) {
|
84
|
-
val.all? { |k, v| String === k && RECURSIVE_JSON_SAFE[v.class].call(v) }
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
|
-
RECURSIVE_JSON_SAFE.default = ->(_val) { false }
|
89
|
-
RECURSIVE_JSON_SAFE.compare_by_identity
|
90
|
-
private_constant :RECURSIVE_JSON_SAFE
|
91
|
-
|
92
|
-
def json_safe?(item)
|
93
|
-
RECURSIVE_JSON_SAFE[item.class].call(item)
|
94
|
-
end
|
95
|
-
|
96
|
-
def json_unsafe_item(item)
|
97
|
-
case item
|
98
|
-
when String, Integer, Float, TrueClass, FalseClass, NilClass
|
99
|
-
nil
|
100
|
-
when Array
|
101
|
-
item.each do |e|
|
102
|
-
unsafe_item = json_unsafe_item(e)
|
80
|
+
val.each do |e|
|
81
|
+
unsafe_item = RECURSIVE_JSON_UNSAFE[e.class].call(e)
|
103
82
|
return unsafe_item unless unsafe_item.nil?
|
104
83
|
end
|
105
84
|
nil
|
106
|
-
|
107
|
-
|
85
|
+
},
|
86
|
+
Hash => ->(val) {
|
87
|
+
val.each do |k, v|
|
108
88
|
return k unless String === k
|
109
89
|
|
110
|
-
unsafe_item =
|
90
|
+
unsafe_item = RECURSIVE_JSON_UNSAFE[v.class].call(v)
|
111
91
|
return unsafe_item unless unsafe_item.nil?
|
112
92
|
end
|
113
93
|
nil
|
114
|
-
|
115
|
-
|
116
|
-
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
RECURSIVE_JSON_UNSAFE.default = ->(val) { val }
|
98
|
+
RECURSIVE_JSON_UNSAFE.compare_by_identity
|
99
|
+
private_constant :RECURSIVE_JSON_UNSAFE
|
100
|
+
|
101
|
+
def json_unsafe?(item)
|
102
|
+
RECURSIVE_JSON_UNSAFE[item.class].call(item)
|
117
103
|
end
|
118
104
|
end
|
119
105
|
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.0.
|
4
|
+
version: 7.0.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-02-
|
11
|
+
date: 2023-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
|
-
rubygems_version: 3.4.
|
230
|
+
rubygems_version: 3.4.7
|
231
231
|
signing_key:
|
232
232
|
specification_version: 4
|
233
233
|
summary: Simple, efficient background processing for Ruby
|