migrated lab1 minimum to lab2

This commit is contained in:
2026-10-26 14:22:05 +03:00
parent 65003b6119
commit 3bd25a9127
14 changed files with 743 additions and 9 deletions
+23
View File
@@ -0,0 +1,23 @@
import os
from dataclasses import dataclass
@dataclass(frozen=True)
class Settings:
host: str
port: int
env: str
log_level: str
shutdown_timeout: int
session_ttl_seconds: int
def load_settings() -> Settings:
return Settings(
host=os.getenv('APP_HOST', '0.0.0.0'),
port=int(os.getenv('APP_PORT', '8080')),
env=os.getenv('APP_ENV', 'lab'),
log_level=os.getenv('LOG_LEVEL', 'info').lower(),
shutdown_timeout=int(os.getenv('SHUTDOWN_TIMEOUT_SECONDS', '5')),
session_ttl_seconds=int(os.getenv('SESSION_TTL_SECONDS', '3600')),
)