Skip to content

Commit e6a84f4

Browse files
committed
Redis.from_url() should have an auto-closing connection pool.
1 parent 2732a85 commit e6a84f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redis/asyncio/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ class initializer. In the case of conflicting arguments, querystring
146146
"""
147147
single_connection_client = kwargs.pop("single_connection_client", False)
148148
connection_pool = ConnectionPool.from_url(url, **kwargs)
149-
return cls(
149+
redis = cls(
150150
connection_pool=connection_pool,
151151
single_connection_client=single_connection_client,
152152
)
153+
redis.auto_close_connection_pool = True
154+
return redis
153155

154156
def __init__(
155157
self,

0 commit comments

Comments
 (0)