Parse config.yaml into typed AppConfig dataclass
- ServerConfig, VideoConfig, ModelConfig, DeadBugConfig, AudioConfig, LoggingConfig as nested dataclasses - Consumers use config.server.host, config.model.resolved_path etc. - env var overrides preserved via _apply_env_overrides()
This commit is contained in:
@@ -7,7 +7,7 @@ import websockets
|
||||
from loguru import logger
|
||||
|
||||
from app.webrtc.peer_session import PeerSession
|
||||
from configs.load import WS_HOST, WS_MAX_SIZE, WS_PORT
|
||||
from configs.load import config
|
||||
|
||||
|
||||
async def handle_client(websocket):
|
||||
@@ -21,6 +21,7 @@ async def handle_client(websocket):
|
||||
|
||||
|
||||
async def main():
|
||||
logger.info(f"WebRTC signaling server: ws://{WS_HOST}:{WS_PORT}")
|
||||
async with websockets.serve(handle_client, WS_HOST, WS_PORT, max_size=WS_MAX_SIZE):
|
||||
cfg = config.server
|
||||
logger.info(f"WebRTC signaling server: ws://{cfg.host}:{cfg.port}")
|
||||
async with websockets.serve(handle_client, cfg.host, cfg.port, max_size=cfg.max_ws_size):
|
||||
await asyncio.Future()
|
||||
|
||||
Reference in New Issue
Block a user