From bbff7623d8b979c8be3e6ab1eeab6d7b1349a1ca Mon Sep 17 00:00:00 2001 From: Alex Hoffmann Date: Wed, 10 Apr 2024 20:34:44 +0400 Subject: [PATCH] Asynchroneous close of response --- replicate/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/replicate/client.py b/replicate/client.py index f7e0b645..5f1e4394 100644 --- a/replicate/client.py +++ b/replicate/client.py @@ -305,7 +305,7 @@ async def handle_async_request(self, request: httpx.Request) -> httpx.Response: ): return response - response.close() + await response.aclose() sleep_for = self._calculate_sleep(attempts_made, response.headers) await asyncio.sleep(sleep_for)