sidekiq-limit_fetch 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef6df5b6610853ca8550db4c675d22e8912dd5fb
4
- data.tar.gz: 81cd166f3ebafa15e8465d12516096010e966ef3
3
+ metadata.gz: 45106fd76c4d8e0bb1621e904f0826b08450ac42
4
+ data.tar.gz: 776c116e27e48b3262a7a201f9fd7e3843c800e0
5
5
  SHA512:
6
- metadata.gz: ba4c3c6d4a353649696d9a3520e8530e51599feb74adf3b159662415aa90aa872cfbff912cfb2d9474b9b1df19e44daa10d37afb7f660954592ff4b5e3d8bab0
7
- data.tar.gz: ffede9ef755246387d6aad5062f391972f701fc4ca19ad69c1fdc7c83153f258ba881293c29d00a81c1bbeef8e992131e6d079e12dccb70668ab25ba748ff1f6
6
+ metadata.gz: 19b51939f0560f367ee1ccb167c0b251f3dc6af1abd0cf4cac9f76eb760c098c8a479e99ddc1cdb3d068f4c3267ccdad49174505cb2e49fb82b59ede7a0eba36
7
+ data.tar.gz: f975a401b537405c83c597490b42cf37d46f9ee5c433744accb5dd28ea6b27d5c377f85fe6518117118eaf93adfe9f318713faae16c56117ada55be3f5cfede2
@@ -19,7 +19,9 @@ class Sidekiq::LimitFetch
19
19
  end
20
20
 
21
21
  def release_except(full_name)
22
- @selector.release restore.delete_if {|name| full_name.to_s.include? name }
22
+ queues = restore
23
+ queues.delete full_name[/queue:(.*)/, 1] if full_name
24
+ @selector.release queues
23
25
  end
24
26
 
25
27
  private
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'sidekiq-limit_fetch'
3
- gem.version = '1.3'
3
+ gem.version = '1.4'
4
4
  gem.authors = 'brainopia'
5
5
  gem.email = 'brainopia@evilmartians.com'
6
6
  gem.summary = 'Sidekiq strategy to support queue limits'
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Sidekiq::LimitFetch::Global::Monitor do
4
4
  let(:global) { true }
5
5
  let(:monitor) { described_class.start! ttl, timeout }
6
- let(:ttl) { 3 }
6
+ let(:ttl) { 1 }
7
7
  let(:queue) { Sidekiq::Queue[name] }
8
8
  let(:name) { 'default' }
9
9
 
@@ -16,14 +16,15 @@ describe Sidekiq::LimitFetch::Global::Monitor do
16
16
  end
17
17
 
18
18
  context 'old locks' do
19
- let(:timeout) { 100 }
19
+ let(:timeout) { 0.5 }
20
20
 
21
21
  it 'should remove invalidated old locks' do
22
22
  2.times { queue.acquire }
23
- described_class.send(:invalidate_old_processors)
23
+ sleep 2*ttl
24
24
  queue.busy.should == 2
25
- sleep 5
26
- described_class.send(:invalidate_old_processors)
25
+
26
+ described_class.stub :update_heartbeat
27
+ sleep 2*ttl
27
28
  queue.busy.should == 0
28
29
  end
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-limit_fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - brainopia