Redis: redis.Redis arguments are ignored if there's a connection pool

This commit is contained in:
Ask Solem 2012-11-22 17:39:27 +00:00
parent 0bc04e6075
commit 73ee6789f6
1 changed files with 8 additions and 7 deletions

View File

@ -564,7 +564,7 @@ class Channel(virtual.Channel):
pass
super(Channel, self).close()
def _create_client(self):
def _connparams(self):
conninfo = self.connection.client
database = conninfo.virtual_host
if not isinstance(database, int):
@ -577,15 +577,16 @@ class Channel(virtual.Channel):
except ValueError:
raise ValueError(
'Database name must be int between 0 and limit - 1')
return {'host': conninfo.hostname or '127.0.0.1',
'port': conninfo.port or DEFAULT_PORT,
'db': database,
'password': conninfo.password}
return self.Client(host=conninfo.hostname or '127.0.0.1',
port=conninfo.port or DEFAULT_PORT,
db=database,
password=conninfo.password,
connection_pool=self.pool)
def _create_client(self):
return self.Client(connection_pool=self.pool)
def _get_pool(self):
return redis.ConnectionPool()
return redis.ConnectionPool(**self._connparams())
def _get_client(self):
if redis.VERSION < (2, 4, 4):