Open
Description
hi
i use go 1.23 on linux 64 bit
today my redis has a problem and i restarted that but my golang code have error and not reconnected
this is my code
RedisClient = redis.NewClient(&redis.Options{
Addr: ip + ":" + port, //"localhost:6379",
Password: password,
DB: db,
PoolSize: poolSize,
ConnMaxLifetime: time.Minute * 10,
DialTimeout: time.Second * 10,
ReadTimeout: time.Second * 30,
WriteTimeout: time.Second * 10,
MaxRetries: 3000,
MinRetryBackoff: time.Second * 2,
MaxRetryBackoff: time.Second * 10,
OnConnect: func(ctx context.Context, cn *redis.Conn) error {
logger.Info("ConRedis connected")
return nil
},
})
if err := RedisClient.Ping(context.Background()).Err(); err != nil {
// Handle connection error
logger.Error("ConRedis error")
}
i get error : redis: connection pool timeout
why pool connection not renew?or not reconnect again?after i restarted my code it work !!!
Metadata
Metadata
Assignees
Labels
No labels