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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2.3.2
2
+ -----------
3
+
4
+ - Fix retry. 2.3.1 accidentally disabled it.
5
+
1
6
  2.3.1
2
7
  -----------
3
8
 
@@ -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
- item['class'].get_sidekiq_options.merge normalized_item
126
+ normalized_item
127
127
  end
128
128
 
129
129
  end
@@ -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.strftime("%Y/%m/%d %H:%M:%S %Z")}
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
@@ -1,3 +1,4 @@
1
+ require 'socket'
1
2
  require 'sidekiq/exception_handler'
2
3
 
3
4
  module Sidekiq
@@ -37,5 +38,9 @@ module Sidekiq
37
38
  def process_id
38
39
  Process.pid
39
40
  end
41
+
42
+ def hostname
43
+ Socket.gethostname
44
+ end
40
45
  end
41
46
  end
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
@@ -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.1
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-14 00:00:00.000000000 Z
12
+ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis