sidekiq 2.3.1 → 2.3.2
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.
- data/Changes.md +5 -0
- data/lib/sidekiq/client.rb +2 -2
- data/lib/sidekiq/processor.rb +1 -6
- data/lib/sidekiq/util.rb +5 -0
- data/lib/sidekiq/version.rb +1 -1
- data/test/test_client.rb +5 -0
- metadata +2 -2
data/Changes.md
CHANGED
data/lib/sidekiq/client.rb
CHANGED
@@ -118,12 +118,12 @@ module Sidekiq
|
|
118
118
|
raise(ArgumentError, "Message must include a class and set of arguments: #{item.inspect}") if !item['class'] || !item['args']
|
119
119
|
raise(ArgumentError, "Message must include a Sidekiq::Worker class, not class name: #{item['class'].ancestors.inspect}") if !item['class'].is_a?(Class) || !item['class'].respond_to?('get_sidekiq_options')
|
120
120
|
|
121
|
-
normalized_item = item.dup
|
121
|
+
normalized_item = item['class'].get_sidekiq_options.merge(item.dup)
|
122
122
|
normalized_item['class'] = normalized_item['class'].to_s
|
123
123
|
normalized_item['retry'] = !!normalized_item['retry']
|
124
124
|
normalized_item['jid'] = SecureRandom.hex(12)
|
125
125
|
|
126
|
-
|
126
|
+
normalized_item
|
127
127
|
end
|
128
128
|
|
129
129
|
end
|
data/lib/sidekiq/processor.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'socket'
|
2
1
|
require 'celluloid'
|
3
2
|
require 'sidekiq/util'
|
4
3
|
|
@@ -67,7 +66,7 @@ module Sidekiq
|
|
67
66
|
conn.multi do
|
68
67
|
conn.sadd('workers', self)
|
69
68
|
conn.setex("worker:#{self}:started", EXPIRY, Time.now.to_s)
|
70
|
-
hash = {:queue => queue, :payload => msg, :run_at => Time.now.
|
69
|
+
hash = {:queue => queue, :payload => msg, :run_at => Time.now.to_i }
|
71
70
|
conn.setex("worker:#{self}", EXPIRY, Sidekiq.dump_json(hash))
|
72
71
|
end
|
73
72
|
end
|
@@ -106,9 +105,5 @@ module Sidekiq
|
|
106
105
|
SINGLETON_CLASSES.include?(val.class) ? val : val.clone
|
107
106
|
end
|
108
107
|
end
|
109
|
-
|
110
|
-
def hostname
|
111
|
-
@h ||= Socket.gethostname
|
112
|
-
end
|
113
108
|
end
|
114
109
|
end
|
data/lib/sidekiq/util.rb
CHANGED
data/lib/sidekiq/version.rb
CHANGED
data/test/test_client.rb
CHANGED
@@ -144,4 +144,9 @@ class TestClient < MiniTest::Unit::TestCase
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
+
describe 'item normalization' do
|
148
|
+
it 'defaults retry to true' do
|
149
|
+
assert_equal true, Sidekiq::Client.normalize_item('class' => QueuedWorker, 'args' => [])['retry']
|
150
|
+
end
|
151
|
+
end
|
147
152
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|