Sha256: 1a35c96d7261c3bb57646bd8681b9af3e39c7b38019145e36d682bc170208bb9

Contents?: true

Size: 813 Bytes

Versions: 8

Compression:

Stored size: 813 Bytes

Contents

require 'sidekiq/limit_fetch'

Sidekiq.logger = nil
Sidekiq.redis = { namespace: ENV['namespace'] }

RSpec.configure do |config|
  config.order = :random
  config.disable_monkey_patching!
  config.raise_errors_for_deprecations!
  config.before do
    Sidekiq::Queue.reset_instances!
    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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rcgt-sidekiq-limit_fetch-3.4.1 spec/spec_helper.rb
sidekiq-limit_fetch-3.4.0 spec/spec_helper.rb
sidekiq-limit_fetch-3.3.1 spec/spec_helper.rb
sidekiq-limit_fetch-3.3.0 spec/spec_helper.rb
sidekiq-limit_fetch-3.2.1 spec/spec_helper.rb
sidekiq-limit_fetch-3.1.0 spec/spec_helper.rb
sidekiq-limit_fetch-3.0.1 spec/spec_helper.rb
sidekiq-limit_fetch-3.0.0 spec/spec_helper.rb