auto remove stale sheets and email users

This commit is contained in:
msramalho
2025-02-07 17:57:02 +00:00
parent eccd71d168
commit 83ba9884f6
6 changed files with 125 additions and 11 deletions

View File

@@ -36,16 +36,16 @@ def get_db_dependency():
with get_db() as db:
yield db
# ASYNC connections
async def make_async_engine(database_url: str) -> AsyncEngine:
engine = create_async_engine(database_url, connect_args={"check_same_thread": False})
return engine
async def make_async_session_local(engine: AsyncEngine) -> AsyncSession:
return async_sessionmaker(engine, expire_on_commit=False)
return async_sessionmaker(engine, expire_on_commit=False, autoflush=False, autocommit=False)
@asynccontextmanager