Добавлено логирование основыных компонентов

This commit is contained in:
Ярослав Малинин 2026-04-24 22:33:12 +03:00
parent 9e7d5d9add
commit 64c9c4a622
7 changed files with 210 additions and 88 deletions

View file

@ -5,12 +5,18 @@ from fastapi import FastAPI
from src.api.external import router as ws_router
from src.agent import AgentService
from src.core.logger import get_logger
logger = get_logger(__name__)
@asynccontextmanager
async def lifespan(app: FastAPI):
logger.info("Инициализация AgentService...")
AgentService() # инициализируем синглтон
logger.info("AgentService инициализирован")
yield
app = FastAPI(lifespan=lifespan)
logger.info("FastAPI инициализирован")
app.include_router(ws_router)