cleanup and fix runtime bugs

This commit is contained in:
qananasikq
2026-04-09 20:34:48 +03:00
parent eb9fb48ea0
commit f6d7c8ea60
28 changed files with 693 additions and 628 deletions

View File

@@ -1,4 +1,4 @@
"""FastAPI app."""
# Создание FastAPI-приложения и настройка его жизненного цикла.
from contextlib import asynccontextmanager
@@ -11,7 +11,7 @@ from .routes import cars, health, tasks
@asynccontextmanager
async def lifespan(app: FastAPI):
"""Жизненный цикл."""
# Жизненный цикл.
persistence: PersistenceService = app.state.persistence
persistence.create_tables()
yield
@@ -37,5 +37,5 @@ def create_app(settings: Settings | None = None) -> FastAPI:
return app
# Для запуска через uvicorn.
# Экземпляр приложения для запуска через uvicorn.
app = create_app()