sidekiq-middleware 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,7 +1,12 @@
1
+ 0.0.6
2
+ -----------
3
+
4
+ - Now all unique locks are prefixed with "locks:unique:" and could be found using wildcard
5
+
1
6
  0.0.5
2
7
  -----------
3
8
 
4
- - Fixed arguments passed to Hash#slice to be compatible with ActiveSupport slice
9
+ - Fixed arguments passed to Hash#slice to be convinient with ActiveSupport slice
5
10
 
6
11
  0.0.4
7
12
  -----------
@@ -17,7 +17,7 @@ module Sidekiq
17
17
  payload.delete('at')
18
18
  end
19
19
 
20
- payload_hash = Digest::MD5.hexdigest(Sidekiq.dump_json(payload))
20
+ payload_hash = "locks:unique:#{Digest::MD5.hexdigest(Sidekiq.dump_json(payload))}"
21
21
 
22
22
  Sidekiq.redis do |conn|
23
23
  conn.watch(payload_hash)
@@ -28,7 +28,7 @@ module Sidekiq
28
28
  payload.delete('at')
29
29
  end
30
30
 
31
- Sidekiq.redis { |conn| conn.del Digest::MD5.hexdigest(Sidekiq.dump_json(payload)) }
31
+ Sidekiq.redis { |conn| conn.del "locks:unique:#{Digest::MD5.hexdigest(Sidekiq.dump_json(payload))}" }
32
32
  end
33
33
  end
34
34
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Middleware
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -63,9 +63,10 @@ class TestUniqueJobs < MiniTest::Unit::TestCase
63
63
  it 'allows the job to reschedule itself with enabled forever option' do
64
64
  5.times {
65
65
  msg = Sidekiq.dump_json('class' => UniqueScheduledWorker.to_s, 'args' => ['something'])
66
- @boss.expect(:processor_done!, nil, [@processor])
66
+ actor = MiniTest::Mock.new
67
+ actor.expect(:processor_done, nil, [@processor])
68
+ @boss.expect(:async, actor, [])
67
69
  @processor.process(msg, 'default')
68
- @boss.verify
69
70
  }
70
71
  assert_equal 1, Sidekiq.redis { |c| c.zcard('schedule') }
71
72
  end
@@ -73,9 +74,10 @@ class TestUniqueJobs < MiniTest::Unit::TestCase
73
74
  it 'discards non critical information about the message' do
74
75
  5.times {|i|
75
76
  msg = Sidekiq.dump_json('class' => UniqueScheduledWorker.to_s, 'args' => ['something'], 'sent_at' => (Time.now + i*60).to_f)
76
- @boss.expect(:processor_done!, nil, [@processor])
77
+ actor = MiniTest::Mock.new
78
+ actor.expect(:processor_done, nil, [@processor])
79
+ @boss.expect(:async, actor, [])
77
80
  @processor.process(msg, 'default')
78
- @boss.verify
79
81
  }
80
82
  assert_equal 1, Sidekiq.redis { |c| c.zcard('schedule') }
81
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-middleware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-10-14 00:00:00.000000000 Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -95,18 +95,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  - - ! '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
- segments:
99
- - 0
100
- hash: -66154321417516575
101
98
  required_rubygems_version: !ruby/object:Gem::Requirement
102
99
  none: false
103
100
  requirements:
104
101
  - - ! '>='
105
102
  - !ruby/object:Gem::Version
106
103
  version: '0'
107
- segments:
108
- - 0
109
- hash: -66154321417516575
110
104
  requirements: []
111
105
  rubyforge_project:
112
106
  rubygems_version: 1.8.24