Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -25,7 +25,7 @@ engine: AsyncEngine = create_async_engine(
|
||||
)
|
||||
|
||||
|
||||
async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
||||
async def get_db() -> AsyncGenerator[AsyncSession]:
|
||||
"""Get a database session for dependency injection."""
|
||||
logger = get_logger(__name__)
|
||||
async with AsyncSession(engine) as session:
|
||||
|
||||
@@ -17,7 +17,7 @@ from app.services.socket import socket_manager
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
async def lifespan(_app: FastAPI) -> AsyncGenerator[None]:
|
||||
"""Application lifespan context manager for setup and teardown."""
|
||||
setup_logging()
|
||||
logger = get_logger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user