This commit is contained in:
2025-09-15 17:28:12 +08:00
parent 185bc88e21
commit 318e6f56a9
9 changed files with 887 additions and 577 deletions

View File

@@ -14,19 +14,19 @@ const dbConfig = {
dateStrings: true,
// 连接池配置
connectionLimit: 20, // 连接池最大连接数
queueLimit: 10, // 排队等待连接的最大数量0表示无限制
// queueLimit: 10, // 排队等待连接的最大数量0表示无限制
// 连接超时配置
// acquireTimeout: 60000, // 获取连接超时时间 60秒
// timeout: 60000, // 查询超时时间 60秒
// reconnect: true, // 自动重连
// 连接保活配置
multipleStatements: true,
// multipleStatements: true,
// 空闲连接超时配置
idleTimeout: 300000, // 5分钟空闲超时
// idleTimeout: 300000, // 5分钟空闲超时
// maxLifetime: 1800000, // 30分钟最大生命周期
// 连接保活设置
keepAliveInitialDelay: 0, // 开始保活探测前的延迟时间
enableKeepAlive: true, // 启用TCP保活
// keepAliveInitialDelay: 0, // 开始保活探测前的延迟时间
// enableKeepAlive: true, // 启用TCP保活
// 添加类型转换配置
typeCast: function (field, next) {
if (field.type === 'TINY' && field.length === 1) {