Skip to content

Commit

Permalink
πŸ› Attempt to avoid connection pool running out of connections (#3947)
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHK authored Mar 7, 2023
1 parent 5a04039 commit 67722c9
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,15 @@ def __init__(
) -> None:
self.request_timeout: int = request_timeout

client_args: dict[str, Any] = {}
client_args: dict[str, Any] = {
# NOTE: the default httpx pool limit configurations look good
# https://www.python-httpx.org/advanced/#pool-limit-configuration
# instruct the remote uvicorn web server to close the connections
# https://www.uvicorn.org/server-behavior/#http-headers
"headers": {
"Connection": "Close",
}
}
if base_url:
client_args["base_url"] = base_url
if timeout:
Expand Down

0 comments on commit 67722c9

Please sign in to comment.