1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Default redis pool size to concurrency + 2, fixes #116

This commit is contained in:
Mike Perham 2012-04-06 09:43:02 -07:00
parent 16fa99c875
commit a587be0bd7

View file

@ -6,7 +6,9 @@ module Sidekiq
class RedisConnection
def self.create(options={})
url = options[:url] || ENV['REDISTOGO_URL'] || 'redis://localhost:6379/0'
size = (options[:size] || Sidekiq.options[:concurrency] || 25)
# need a connection for Fetcher and Retry
size = options[:size] || (Sidekiq.options[:concurrency] + 2)
ConnectionPool.new(:timeout => 1, :size => size) do
build_client(url, options[:namespace])
end