1
0
Fork 0
mirror of https://github.com/deanpcmad/sidekiq-limit_fetch.git synced 2022-11-09 13:54:36 -05:00
deanpcmad--sidekiq-limit_fetch/spec/spec_helper.rb
2013-06-22 22:12:42 +04:00

26 lines
738 B
Ruby

require 'sidekiq/limit_fetch'
require 'celluloid/autostart'
require 'sidekiq/fetch'
Sidekiq.logger = nil
Sidekiq.redis = { namespace: ENV['namespace'] }
RSpec.configure do |config|
config.before :each do
Sidekiq.redis do |it|
clean_redis = ->(queue) do
it.pipelined do
it.del "limit_fetch:limit:#{queue}"
it.del "limit_fetch:process_limit:#{queue}"
it.del "limit_fetch:busy:#{queue}"
it.del "limit_fetch:probed:#{queue}"
it.del "limit_fetch:pause:#{queue}"
it.del "limit_fetch:block:#{queue}"
end
end
clean_redis.call(name) if defined?(name)
queues.each(&clean_redis) if defined?(queues) and queues.is_a? Array
end
end
end