File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,16 @@ async def get_status():
6666 root_path = config ["DOCS_URL_PREFIX" ],
6767 generate_unique_id_function = generate_unique_route_id ,
6868 )
69- # TODO check ideal timeout for AWS calls
70- app .async_client = httpx_client or httpx .AsyncClient (timeout = 300 )
69+
70+ # `async_client` is used to hit the TES API, the Arborist service and AWS S3.
71+ # Calls to S3 tend to timeout when uploading large files (and we might also be rate-limited).
72+ # AsyncHTTPTransport supports retrying on httpx.ConnectError or httpx.ConnectTimeout.
73+ # The `httpx_client` parameter is not meant to be used in production. It allows mocking
74+ # external calls when testing.
75+ app .async_client = httpx_client or httpx .AsyncClient (
76+ transport = httpx .AsyncHTTPTransport (retries = 3 ), timeout = 120
77+ )
78+
7179 app .include_router (ga4gh_tes_router , tags = ["GA4GH TES" ])
7280 app .include_router (s3_router , tags = ["S3" ])
7381 app .include_router (storage_router , tags = ["Storage" ])
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ async def handle_request(request: Request):
349349 httpx_client_function = getattr (httpx .AsyncClient (), request .method .lower ())
350350 return await httpx_client_function (url )
351351
352- # set the httpx clients used by the app and by the Arborist client to mock clients that
352+ # the httpx clients used by the app and by gen3authz are set to mock clients that
353353 # call `handle_request`
354354 mock_httpx_client = httpx .AsyncClient (transport = httpx .MockTransport (handle_request ))
355355 app = get_app (httpx_client = mock_httpx_client )
You can’t perform that action at this time.
0 commit comments