mirror of
				https://github.com/deanpcmad/sidekiq-limit_fetch.git
				synced 2022-11-09 13:54:36 -05:00 
			
		
		
		
	Fix regression
This commit is contained in:
		
							parent
							
								
									20220faf01
								
							
						
					
					
						commit
						bc3ca08d6e
					
				
					 3 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -37,6 +37,7 @@ class Sidekiq::LimitFetch
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  def redis_blpop(*args)
 | 
			
		||||
    return if args.size < 2
 | 
			
		||||
    Sidekiq.redis {|it| it.blpop *args }
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ require 'spec_helper'
 | 
			
		|||
describe Sidekiq::LimitFetch::Global::Monitor do
 | 
			
		||||
  let(:global) { true }
 | 
			
		||||
  let(:monitor) { described_class.start! ttl, timeout }
 | 
			
		||||
  let(:ttl) { 2 }
 | 
			
		||||
  let(:ttl) { 3 }
 | 
			
		||||
  let(:queue) { Sidekiq::Queue[name] }
 | 
			
		||||
  let(:name) { 'default' }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ describe Sidekiq::LimitFetch::Global::Monitor do
 | 
			
		|||
      2.times { queue.acquire }
 | 
			
		||||
      described_class.send(:invalidate_old_processors)
 | 
			
		||||
      queue.busy.should == 2
 | 
			
		||||
      sleep 4
 | 
			
		||||
      sleep 5
 | 
			
		||||
      described_class.send(:invalidate_old_processors)
 | 
			
		||||
      queue.busy.should == 0
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,6 +10,7 @@ RSpec.configure do |config|
 | 
			
		|||
        it.del "limit_fetch:limit:#{queue}"
 | 
			
		||||
        it.del "limit_fetch:busy:#{queue}"
 | 
			
		||||
        it.del "limit_fetch:pause:#{queue}"
 | 
			
		||||
        it.del "limit_fetch:block:#{queue}"
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      clean_redis.call(name) if defined?(name)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue