mirror of https://github.com/celery/kombu.git
Redis: redis.Redis arguments are ignored if there's a connection pool
This commit is contained in:
parent
0bc04e6075
commit
73ee6789f6
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue