mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 16:28:11 +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:
parent
9b39bfb845
commit
8975f63e2f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user