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 1
1
import logging
2
2
from dataclasses import dataclass
3
+ from typing import Final
3
4
4
5
import httpx
5
6
from fastapi import FastAPI
6
- from httpx import AsyncClient
7
+ from httpx import AsyncClient , Timeout
7
8
from servicelib .fastapi .tracing import setup_httpx_client_tracing
8
9
from settings_library .tracing import TracingSettings
9
10
10
11
from .app_data import AppDataMixin
11
12
12
13
_logger = logging .getLogger (__name__ )
13
14
15
+ _DEFAULT_BASE_SERVICE_CLIENT_API_TIMEOUT_SECONDS : Final [int ] = 60
16
+
14
17
15
18
@dataclass
16
19
class BaseServiceClientApi (AppDataMixin ):
@@ -52,7 +55,10 @@ def setup_client_instance(
52
55
53
56
assert issubclass (api_cls , BaseServiceClientApi ) # nosec
54
57
# 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
+ )
56
62
if tracing_settings :
57
63
setup_httpx_client_tracing (client )
58
64
You can’t perform that action at this time.
0 commit comments