Skip to content

Commit d6aa6e6

Browse files
committed
auto_close_connection_pool is ignored if a pool is provided
1 parent ec33be1 commit d6aa6e6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: redis/asyncio/sentinel.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ def master_for(
339339
connection_pool = connection_pool_class(service_name, self, **connection_kwargs)
340340
# The Redis object "owns" the pool
341341
auto_close_connection_pool = True
342-
return redis_class(
342+
client = redis_class(
343343
connection_pool=connection_pool,
344-
auto_close_connection_pool=auto_close_connection_pool,
345344
)
345+
client.auto_close_connection_pool = auto_close_connection_pool
346+
return client
346347

347348
def slave_for(
348349
self,
@@ -375,7 +376,9 @@ def slave_for(
375376
connection_pool = connection_pool_class(service_name, self, **connection_kwargs)
376377
# The Redis object "owns" the pool
377378
auto_close_connection_pool = True
378-
return redis_class(
379+
client = redis_class(
379380
connection_pool=connection_pool,
380-
auto_close_connection_pool=auto_close_connection_pool,
381381
)
382+
client.auto_close_connection_pool = auto_close_connection_pool
383+
return client
384+

0 commit comments

Comments
 (0)