File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
services/api-server/src/simcore_service_api_server/utils Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import logging
22from dataclasses import dataclass
3+ from typing import Final
34
45import httpx
56from fastapi import FastAPI
6- from httpx import AsyncClient
7+ from httpx import AsyncClient , Timeout
78from servicelib .fastapi .tracing import setup_httpx_client_tracing
89from settings_library .tracing import TracingSettings
910
1011from .app_data import AppDataMixin
1112
1213_logger = logging .getLogger (__name__ )
1314
15+ _DEFAULT_BASE_SERVICE_CLIENT_API_TIMEOUT_SECONDS : Final [int ] = 60
16+
1417
1518@dataclass
1619class BaseServiceClientApi (AppDataMixin ):
@@ -52,7 +55,10 @@ def setup_client_instance(
5255
5356 assert issubclass (api_cls , BaseServiceClientApi ) # nosec
5457 # NOTE: this term is mocked in tests. If you need to modify pay attention to the mock
55- client = AsyncClient (base_url = api_baseurl )
58+ client = AsyncClient (
59+ base_url = api_baseurl ,
60+ timeout = Timeout (_DEFAULT_BASE_SERVICE_CLIENT_API_TIMEOUT_SECONDS ),
61+ )
5662 if tracing_settings :
5763 setup_httpx_client_tracing (client )
5864
You can’t perform that action at this time.
0 commit comments