From e1ce920b1594da467c72e8cb69828e568ec9d25c Mon Sep 17 00:00:00 2001 From: Max Spransy Date: Thu, 9 Feb 2012 09:37:00 -0600 Subject: [PATCH] set redis namespace only in initializer --- lib/sidekiq/redis_connection.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/redis_connection.rb b/lib/sidekiq/redis_connection.rb index 825f5696..4974eadb 100644 --- a/lib/sidekiq/redis_connection.rb +++ b/lib/sidekiq/redis_connection.rb @@ -4,8 +4,9 @@ require 'redis/namespace' module Sidekiq class RedisConnection def self.create(url = nil, namespace = nil, pool = true) - @namespace = namespace if namespace + @namespace = namespace ? namespace : nil @url = url ? url : nil + if pool ConnectionPool.new { connect } else @@ -23,7 +24,7 @@ module Sidekiq end def self.namespace - @namespace ||= nil + @namespace end def self.url