mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-19 07:48:10 +00:00
Fix AsyncSession handling after breaking changes in FastAPI 0.74.0
See https://github.com/tiangolo/fastapi/releases/tag/0.74.0 for details.
This commit is contained in:
@ -24,7 +24,7 @@ from gns3server.db.repositories.base import BaseRepository
|
||||
|
||||
async def get_db_session(request: HTTPConnection) -> AsyncSession:
|
||||
|
||||
session = AsyncSession(request.app.state._db_engine, expire_on_commit=False)
|
||||
async with AsyncSession(request.app.state._db_engine, expire_on_commit=False) as session:
|
||||
try:
|
||||
yield session
|
||||
finally:
|
||||
|
Reference in New Issue
Block a user