diff --git a/CHANGES b/CHANGES index 879722caf1..363f2b927d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ - * Fix #2831, closing connections and sockets when garbage collected. + * Fix #2831, add auto_close_connection_pool=True arg to asyncio.Redis.from_url() * Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error` * Fix dead weakref in sentinel connection causing ReferenceError (#2767) * Fix #2768, Fix KeyError: 'first-entry' in parse_xinfo_stream. diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py index a380f286c8..31e27a4462 100644 --- a/redis/asyncio/client.py +++ b/redis/asyncio/client.py @@ -104,7 +104,13 @@ class Redis( response_callbacks: MutableMapping[Union[str, bytes], ResponseCallbackT] @classmethod - def from_url(cls, url: str, **kwargs): + def from_url( + cls, + url: str, + single_connection_client: bool = False, + auto_close_connection_pool: bool = True, + **kwargs, + ): """ Return a Redis client object configured from the given URL @@ -144,8 +150,6 @@ class initializer. In the case of conflicting arguments, querystring arguments always win. """ - single_connection_client = kwargs.pop("single_connection_client", False) - auto_close_connection_pool = kwargs.pop("auto_close_connection_pool", True) connection_pool = ConnectionPool.from_url(url, **kwargs) redis = cls( connection_pool=connection_pool,