поменял настройки соединения
Gitea Actions Demo / build_and_push (push) Successful in 28m39s Details

This commit is contained in:
artem 2026-01-20 22:23:07 +03:00
parent 877dde5c18
commit 59758f17a3
1 changed files with 4 additions and 3 deletions

View File

@ -18,13 +18,14 @@ class AsyncDB(AbstractDB):
str(cnf.db_uri),
echo=bool(cnf.app_debug),
connect_args=con_arg,
pool_recycle=1800,
pool_recycle=300,
pool_pre_ping=True,
)
# self.engine.execution_options(stream_results=True)
if self.engine is None:
raise ConnectError
session = asyncio.async_sessionmaker(self.engine, expire_on_commit=True)
session = asyncio.async_sessionmaker(self.engine, expire_on_commit=False)
if session is None:
raise ConnectError
self.async_session = session
@ -35,7 +36,7 @@ class AsyncDB(AbstractDB):
@property
def session(self):
return asyncio.async_sessionmaker(self.engine, expire_on_commit=True)
return asyncio.async_sessionmaker(self.engine, expire_on_commit=False)
def session_master(self):
return self.async_session()