1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Retry timeout by default

This commit is contained in:
Vladimir Mihailenco
2019-08-12 14:53:00 +03:00
parent f6fc23d2fa
commit 39b67358d7
2 changed files with 5 additions and 9 deletions

View File

@ -268,13 +268,12 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder) error {
}
}
var retryTimeout bool
retryTimeout := true
lastErr = c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
err := cn.WithWriter(ctx, c.opt.WriteTimeout, func(wr *proto.Writer) error {
return writeCmd(wr, cmd)
})
if err != nil {
retryTimeout = true
return err
}