File tree Expand file tree Collapse file tree 3 files changed +23
-19
lines changed
packages/service-library/src/servicelib/fastapi
services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/director_v0 Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,10 @@ def __init__(
200200 self ,
201201 * ,
202202 total_retry_interval : float ,
203+ tracing_settings : TracingSettings | None ,
203204 base_url : URLTypes | None = None ,
204205 default_http_client_timeout : TimeoutTypes | None = None ,
205206 extra_allowed_method_names : set [str ] | None = None ,
206- tracing_settings : TracingSettings | None = None ,
207207 ) -> None :
208208 _assert_public_interface (self , extra_allowed_method_names )
209209
Original file line number Diff line number Diff line change 11from fastapi import FastAPI
22
3- from ...core .settings import ApplicationSettings
43from ._public_client import DirectorV0PublicClient
54from ._thin_client import DirectorV0ThinClient
65
76
87def setup_director_v0 (app : FastAPI ) -> None :
9- settings : ApplicationSettings = app .state .settings
10-
118 async def _on_startup () -> None :
12- assert settings .CLIENT_REQUEST .HTTP_CLIENT_REQUEST_TOTAL_TIMEOUT # nosec
13- thin_client = DirectorV0ThinClient (
14- total_retry_interval = int (
15- settings .CLIENT_REQUEST .HTTP_CLIENT_REQUEST_TOTAL_TIMEOUT
16- ),
17- extra_allowed_method_names = {
18- "attach_lifespan_to" ,
19- "get_from_app_state" ,
20- "pop_from_app_state" ,
21- "set_to_app_state" ,
22- },
23- base_url = settings .DYNAMIC_SCHEDULER_DIRECTOR_V0_SETTINGS .endpoint ,
24- tracing_settings = settings .DYNAMIC_SCHEDULER_TRACING ,
25- )
9+ thin_client = DirectorV0ThinClient (app )
2610 thin_client .set_to_app_state (app )
2711 thin_client .attach_lifespan_to (app )
2812
Original file line number Diff line number Diff line change 11import urllib .parse
22
33from common_library .unset import as_dict_exclude_none
4- from fastapi import status
4+ from fastapi import FastAPI , status
55from httpx import Response
66from models_library .projects import ProjectID
77from models_library .projects_nodes_io import NodeID
1616)
1717from yarl import URL
1818
19+ from ...core .settings import ApplicationSettings
20+
1921
2022class DirectorV0ThinClient (
2123 SingletonInAppStateMixin , BaseThinClient , AttachLifespanMixin
2224):
2325 app_state_name : str = "director_v0_thin_client"
2426
27+ def __init__ (self , app : FastAPI ) -> None :
28+ settings : ApplicationSettings = app .state .settings
29+ assert settings .CLIENT_REQUEST .HTTP_CLIENT_REQUEST_TOTAL_TIMEOUT # nosec
30+
31+ super ().__init__ (
32+ total_retry_interval = int (
33+ settings .CLIENT_REQUEST .HTTP_CLIENT_REQUEST_TOTAL_TIMEOUT
34+ ),
35+ extra_allowed_method_names = {
36+ "attach_lifespan_to" ,
37+ "get_from_app_state" ,
38+ "pop_from_app_state" ,
39+ "set_to_app_state" ,
40+ },
41+ base_url = settings .DYNAMIC_SCHEDULER_DIRECTOR_V0_SETTINGS .endpoint ,
42+ tracing_settings = settings .DYNAMIC_SCHEDULER_TRACING ,
43+ )
44+
2545 @retry_on_errors ()
2646 @expect_status (status .HTTP_200_OK )
2747 async def get_running_interactive_service_details (
You can’t perform that action at this time.
0 commit comments