From 73ee6789f6bdd735e6efd9b7b72ec7ac4efb1943 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 22 Nov 2012 17:39:27 +0000 Subject: [PATCH] Redis: redis.Redis arguments are ignored if there's a connection pool --- kombu/transport/redis.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kombu/transport/redis.py b/kombu/transport/redis.py index c4be379b..3c03eec5 100644 --- a/kombu/transport/redis.py +++ b/kombu/transport/redis.py @@ -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):