mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 03:27:31 +08:00
feat(db): add pool class configuration and adjust connection settings
This commit is contained in:
+12
-10
@@ -54,16 +54,18 @@ class ConfigModel(BaseModel):
|
||||
DEV: bool = False
|
||||
# 是否在控制台输出 SQL 语句,默认关闭
|
||||
DB_ECHO: bool = False
|
||||
# 是否在获取连接时进行预先 ping 操作,默认开启
|
||||
DB_POOL_PRE_PING: bool = True
|
||||
# 数据库连接池的大小,默认 100
|
||||
DB_POOL_SIZE: int = 100
|
||||
# 数据库连接的回收时间(秒),默认 3600 秒(1 小时)
|
||||
DB_POOL_RECYCLE: int = 3600
|
||||
# 数据库连接池获取连接的超时时间(秒),默认 180 秒
|
||||
DB_POOL_TIMEOUT: int = 180
|
||||
# 数据库连接池最大溢出连接数,默认 5
|
||||
DB_MAX_OVERFLOW: int = 5
|
||||
# 数据库连接池类型,QueuePool, NullPool
|
||||
DB_POOL_TYPE: str = "QueuePool"
|
||||
# 是否在获取连接时进行预先 ping 操作,默认关闭
|
||||
DB_POOL_PRE_PING: bool = False
|
||||
# 数据库连接池的大小,默认 20
|
||||
DB_POOL_SIZE: int = 20
|
||||
# 数据库连接的回收时间(秒),默认 1800 秒
|
||||
DB_POOL_RECYCLE: int = 1800
|
||||
# 数据库连接池获取连接的超时时间(秒),默认 30 秒
|
||||
DB_POOL_TIMEOUT: int = 30
|
||||
# 数据库连接池最大溢出连接数,默认 10
|
||||
DB_MAX_OVERFLOW: int = 10
|
||||
# SQLite 的 busy_timeout 参数,默认为 60 秒
|
||||
DB_TIMEOUT: int = 60
|
||||
# 配置文件目录
|
||||
|
||||
Reference in New Issue
Block a user