|
@@ -26,6 +26,7 @@ engine = create_engine(
|
|
|
pool_recycle=db_settings.DB_POOL_RECYCLE,
|
|
pool_recycle=db_settings.DB_POOL_RECYCLE,
|
|
|
echo=settings.DEBUG,
|
|
echo=settings.DEBUG,
|
|
|
max_overflow=db_settings.DB_OVERLOW,
|
|
max_overflow=db_settings.DB_OVERLOW,
|
|
|
|
|
+ pool_timeout=30
|
|
|
)
|
|
)
|
|
|
session = scoped_session(sessionmaker(bind=engine))
|
|
session = scoped_session(sessionmaker(bind=engine))
|
|
|
|
|
|
|
@@ -39,6 +40,7 @@ async_engine = create_async_engine(
|
|
|
pool_recycle=db_settings.DB_POOL_RECYCLE,
|
|
pool_recycle=db_settings.DB_POOL_RECYCLE,
|
|
|
echo=settings.DEBUG,
|
|
echo=settings.DEBUG,
|
|
|
max_overflow=db_settings.DB_OVERLOW,
|
|
max_overflow=db_settings.DB_OVERLOW,
|
|
|
|
|
+ pool_timeout=30
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
# 创建session元类
|
|
# 创建session元类
|