mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-21 15:19:32 +08:00
性能优化
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user