From b8ab7da1a9a2323186b176046fbac6f9e89efa78 Mon Sep 17 00:00:00 2001 From: gluap Date: Mon, 14 Feb 2022 22:34:01 +0100 Subject: [PATCH] This allows us to recover from the condition with the broken connections. --- api/obs/api/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/obs/api/db.py b/api/obs/api/db.py index c9b28d8..41c23cf 100644 --- a/api/obs/api/db.py +++ b/api/obs/api/db.py @@ -41,12 +41,12 @@ Base = declarative_base() engine = None -sessionmaker = None +sessionmaker: SessionMaker @asynccontextmanager async def make_session(): - async with sessionmaker() as session: + async with sessionmaker(autoflush=True) as session: yield session