性能优化

This commit is contained in:
xiangheng
2024-07-10 15:36:00 +08:00
parent 69fe1613fa
commit 8f42f5d33b
13 changed files with 139 additions and 75 deletions

View File

@@ -17,7 +17,10 @@ func initRedis() *redis.Client {
if err != nil {
log.Fatal("initRedis redis.ParseURL err: ", err)
}
opt.PoolSize = config.Config.RedisPoolSize
// opt.PoolSize = config.Config.RedisPoolSize
opt.MaxIdleConns = config.Config.RedisMaxIdleConns
opt.ConnMaxLifetime = config.Config.RedisConnMaxLifetime
client := redis.NewClient(opt)
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()