Skip to content

Commit 510233d

Browse files
asynchronously close of response (#309)
The response is closed synchronously in the async path, unnecessarily blocking. The PR closes the response asynchronously instead
1 parent cd422fc commit 510233d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

replicate/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
305305
):
306306
return response
307307

308-
response.close()
308+
await response.aclose()
309309

310310
sleep_for = self._calculate_sleep(attempts_made, response.headers)
311311
await asyncio.sleep(sleep_for)

0 commit comments

Comments
 (0)