Skip to content

Commit 9fe68a9

Browse files
committed
re-add the auto_close_connection_pool arg to Connection.from_url()
1 parent 7000261 commit 9fe68a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

redis/asyncio/client.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def from_url(
114114
cls,
115115
url: str,
116116
single_connection_client: bool = False,
117+
auto_close_connection_pool: bool = True,
117118
**kwargs,
118119
):
119120
"""
@@ -163,7 +164,13 @@ class initializer. In the case of conflicting arguments, querystring
163164
connection_pool=connection_pool,
164165
single_connection_client=single_connection_client,
165166
)
166-
client.auto_close_connection_pool = True
167+
# We should probably deprecate the `auto_close_connection_pool`
168+
# argument.
169+
# If the caller doesn't want the pool auto-closed, a better
170+
# pattern is to create the pool manually (maybe using from_url()),
171+
# pass it in using the `connection_pool`, and hold on to it to close
172+
# it later.
173+
client.auto_close_connection_pool = auto_close_connection_pool
167174
return client
168175

169176
@classmethod

0 commit comments

Comments
 (0)