🔧 update config file

This commit is contained in:
2024-12-18 16:10:48 +08:00
parent 24df28e53f
commit 49831fc4d0
5 changed files with 100 additions and 35 deletions

View File

@@ -23,11 +23,11 @@ func NewMySQL(url string, maxOpenConn int, maxIdleConn int, client *redis.Client
Logger: logger.New(
log.New(os.Stdout, "\r\n", log.LstdFlags),
logger.Config{
SlowThreshold: time.Second, // 慢sql日志
LogLevel: logger.Info, // 级别
Colorful: true, // 颜色
IgnoreRecordNotFoundError: true, // 忽略RecordNotFoundError
ParameterizedQueries: true, // 格式化SQL语句
SlowThreshold: time.Second, // 慢sql日志
LogLevel: logger.Error, // 级别
Colorful: true, // 颜色
IgnoreRecordNotFoundError: true, // 忽略RecordNotFoundError
ParameterizedQueries: true, // 格式化SQL语句
}),
})
if err != nil {
@@ -51,7 +51,7 @@ func NewMySQL(url string, maxOpenConn int, maxIdleConn int, client *redis.Client
CacheTTL: 10000, // 5000 ms
CacheMaxItemCnt: 0, // if length of objects retrieved one single time
AsyncWrite: true, // async write to cache
DebugMode: true,
DebugMode: false,
DisableCachePenetrationProtect: true, // disable cache penetration protect
})
if err != nil {