refactoring settings

This commit is contained in:
s.mostryukov 2024-10-01 18:06:04 +03:00
parent 8fbec57acb
commit c4011f0e45
3 changed files with 9 additions and 5 deletions

View File

@ -0,0 +1,3 @@
NETADM_CONFIG__RUN__HOST = "0.0.0.0"
NETADM_CONFIG__RUN__PORT = 8080
NETADM_CONFIG__RUN__RELOAD = 1

View File

@ -15,9 +15,9 @@ STATIC_DIR = BASE_DIR / "web" / "static"
class RunConfig(BaseModel):
host: str = "0.0.0.0"
port: int = 8000
reload: bool = True
host: str
port: int
reload: bool
class SwaggerConfig(BaseModel):
@ -39,7 +39,7 @@ class Settings(BaseSettings):
env_nested_delimiter="__",
env_prefix="NETADM_CONFIG__",
)
run: RunConfig = RunConfig()
run: RunConfig
swagger: SwaggerConfig = SwaggerConfig()

View File

@ -29,7 +29,8 @@ def parse_input(text: str) -> List[Dict[str, Union[int, str]]]:
def start_check(
text: str, result_type: str = "json"
text: str,
result_type: str = "json",
) -> List[Dict[str, Union[int, str, bool]]] | List[str]:
logging.info("")
result = []