Skip to content

Commit 7c6cf64

Browse files
committed
clean
1 parent ec191f4 commit 7c6cf64

File tree

1 file changed

+5
-16
lines changed
  • services/dask-sidecar/src/simcore_service_dask_sidecar

1 file changed

+5
-16
lines changed

services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
from models_library.basic_types import LogLevel
55
from pydantic import AliasChoices, Field, field_validator
66
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
7-
from settings_library.base import BaseCustomSettings
7+
from settings_library.application import BaseApplicationSettings
88
from settings_library.utils_logging import MixinLoggingSettings
99

1010

11-
class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
12-
SC_BUILD_TARGET: str | None = None
13-
SC_BOOT_MODE: str | None = None
14-
LOG_LEVEL: Annotated[
11+
class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
12+
DASK_SIDECAR_LOGLEVEL: Annotated[
1513
LogLevel,
1614
Field(
1715
validation_alias=AliasChoices(
@@ -23,7 +21,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
2321
SIDECAR_COMP_SERVICES_SHARED_VOLUME_NAME: str
2422
SIDECAR_COMP_SERVICES_SHARED_FOLDER: Path
2523

26-
SIDECAR_INTERVAL_TO_CHECK_TASK_ABORTED_S: int | None = 5
24+
DASK_SIDECAR_INTERVAL_TO_CHECK_TASK_ABORTED_S: int | None = 5
2725

2826
DASK_START_AS_SCHEDULER: bool | None = Field(
2927
default=False, description="If this env is set, then the app boots as scheduler"
@@ -48,16 +46,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
4846
description="is a dictionary that maps specific loggers (such as 'uvicorn.access' or 'gunicorn.access') to a list of log message patterns that should be filtered out.",
4947
)
5048

51-
def as_scheduler(self) -> bool:
52-
return bool(self.DASK_START_AS_SCHEDULER)
53-
54-
def as_worker(self) -> bool:
55-
as_worker = not self.as_scheduler()
56-
if as_worker:
57-
assert self.DASK_SCHEDULER_HOST is not None # nosec
58-
return as_worker
59-
60-
@field_validator("LOG_LEVEL", mode="before")
49+
@field_validator("DASK_SIDECAR_LOGLEVEL", mode="before")
6150
@classmethod
6251
def _validate_loglevel(cls, value: Any) -> str:
6352
return cls.validate_log_level(f"{value}")

0 commit comments

Comments
 (0)