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

chore: always retry write timeouts

This commit is contained in:
Vladimir Mihailenco
2022-10-06 10:06:02 +03:00
parent 6725851465
commit b0231c659e
4 changed files with 5 additions and 9 deletions

View File

@ -341,6 +341,7 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool
return writeCmd(wr, cmd)
})
if err != nil {
atomic.StoreUint32(&retryTimeout, 1)
return err
}
@ -348,6 +349,8 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool
if err != nil {
if cmd.readTimeout() == nil {
atomic.StoreUint32(&retryTimeout, 1)
} else {
atomic.StoreUint32(&retryTimeout, 0)
}
return err
}