fix 提高DB连接等待时间,避免database locked报错。
This commit is contained in:
@ -11,7 +11,8 @@ Engine = create_engine(f"sqlite:///{settings.CONFIG_PATH}/user.db",
|
|||||||
pool_size=1024,
|
pool_size=1024,
|
||||||
pool_recycle=600,
|
pool_recycle=600,
|
||||||
pool_timeout=180,
|
pool_timeout=180,
|
||||||
max_overflow=0)
|
max_overflow=0,
|
||||||
|
connect_args={"timeout": 60})
|
||||||
# 会话工厂
|
# 会话工厂
|
||||||
SessionFactory = sessionmaker(autocommit=False, autoflush=False, bind=Engine)
|
SessionFactory = sessionmaker(autocommit=False, autoflush=False, bind=Engine)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user