fix: gredis maxActive config and duplicate connection bug (#2479)

This commit is contained in:
Gin
2023-02-27 22:08:37 +08:00
committed by GitHub
parent cbbfd85eeb
commit 15d88c269d
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ func New(config *gredis.Config) *Redis {
Password: config.Pass,
DB: config.Db,
MaxRetries: defaultMaxRetries,
PoolSize: config.MaxActive,
MinIdleConns: config.MinIdle,
MaxConnAge: config.MaxConnLifetime,
IdleTimeout: config.IdleTimeout,

View File

@ -58,7 +58,7 @@ func New(config ...*Config) (*Redis, error) {
}
redis := &Redis{
config: config[0],
localAdapter: defaultAdapterFunc(config[0]),
localAdapter: usedAdapter,
}
return redis.initGroup(), nil
}