Skip to content

Commit 30e5521

Browse files
author
Andrei Neagu
committed
removed unused code
1 parent 544f8d4 commit 30e5521

File tree

2 files changed

+3
-54
lines changed

2 files changed

+3
-54
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rest/_dependencies.py

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Free functions to inject dependencies in routes handlers"""
22

3-
from asyncio import Lock
43
from typing import Annotated, cast
54

65
from fastapi import Depends, FastAPI, Request
@@ -9,67 +8,26 @@
98
from servicelib.rabbitmq._client_rpc import RabbitMQRPCClient
109

1110
from ...core import rabbitmq
12-
from ...core.settings import ApplicationSettings
1311
from ...models.schemas.application_health import ApplicationHealth
14-
from ...models.shared_store import SharedStore
15-
from ...modules.inputs import InputsState
16-
from ...modules.mounted_fs import MountedVolumes
17-
from ...modules.outputs import OutputsManager
1812
from ...modules.prometheus_metrics import UserServicesMetrics
1913

2014

2115
def get_application(request: Request) -> FastAPI:
2216
return cast(FastAPI, request.app)
2317

2418

25-
def get_app_state(request: Request) -> State:
19+
def _get_app_state(request: Request) -> State:
2620
return cast(State, request.app.state)
2721

2822

2923
def get_application_health(
30-
app_state: Annotated[State, Depends(get_app_state)],
24+
app_state: Annotated[State, Depends(_get_app_state)],
3125
) -> ApplicationHealth:
3226
return cast(ApplicationHealth, app_state.application_health)
3327

3428

35-
def get_settings(
36-
app_state: Annotated[State, Depends(get_app_state)],
37-
) -> ApplicationSettings:
38-
return cast(ApplicationSettings, app_state.settings)
39-
40-
41-
def get_shared_store(
42-
app_state: Annotated[State, Depends(get_app_state)],
43-
) -> SharedStore:
44-
return cast(SharedStore, app_state.shared_store)
45-
46-
47-
def get_mounted_volumes(
48-
app_state: Annotated[State, Depends(get_app_state)],
49-
) -> MountedVolumes:
50-
return cast(MountedVolumes, app_state.mounted_volumes)
51-
52-
53-
def get_container_restart_lock(
54-
app_state: Annotated[State, Depends(get_app_state)],
55-
) -> Lock:
56-
return cast(Lock, app_state.container_restart_lock)
57-
58-
59-
def get_outputs_manager(
60-
app_state: Annotated[State, Depends(get_app_state)],
61-
) -> OutputsManager:
62-
return cast(OutputsManager, app_state.outputs_manager)
63-
64-
65-
def get_inputs_state(
66-
app_state: Annotated[State, Depends(get_app_state)],
67-
) -> InputsState:
68-
return cast(InputsState, app_state.inputs_state)
69-
70-
7129
def get_user_services_metrics(
72-
app_state: Annotated[State, Depends(get_app_state)],
30+
app_state: Annotated[State, Depends(_get_app_state)],
7331
) -> UserServicesMetrics:
7432
return cast(UserServicesMetrics, app_state.user_service_metrics)
7533

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rest/containers.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@
1818
_logger = logging.getLogger(__name__)
1919

2020

21-
def _raise_if_container_is_missing(
22-
container_id: str, container_names: list[str]
23-
) -> None:
24-
if container_id not in container_names:
25-
message = f"No container '{container_id}' was started. Started containers '{container_names}'"
26-
_logger.warning(message)
27-
raise HTTPException(status.HTTP_404_NOT_FOUND, detail=message)
28-
29-
3021
router = APIRouter()
3122

3223

0 commit comments

Comments
 (0)