поменял настройки соединения
Gitea Actions Demo / build_and_push (push) Successful in 28m39s
Details
Gitea Actions Demo / build_and_push (push) Successful in 28m39s
Details
This commit is contained in:
parent
877dde5c18
commit
59758f17a3
|
|
@ -18,13 +18,14 @@ class AsyncDB(AbstractDB):
|
||||||
str(cnf.db_uri),
|
str(cnf.db_uri),
|
||||||
echo=bool(cnf.app_debug),
|
echo=bool(cnf.app_debug),
|
||||||
connect_args=con_arg,
|
connect_args=con_arg,
|
||||||
pool_recycle=1800,
|
pool_recycle=300,
|
||||||
|
pool_pre_ping=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# self.engine.execution_options(stream_results=True)
|
# self.engine.execution_options(stream_results=True)
|
||||||
if self.engine is None:
|
if self.engine is None:
|
||||||
raise ConnectError
|
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:
|
if session is None:
|
||||||
raise ConnectError
|
raise ConnectError
|
||||||
self.async_session = session
|
self.async_session = session
|
||||||
|
|
@ -35,7 +36,7 @@ class AsyncDB(AbstractDB):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def session(self):
|
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):
|
def session_master(self):
|
||||||
return self.async_session()
|
return self.async_session()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue