1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-14 01:21:30 +03:00

Retry BadConnError

This commit is contained in:
Vladimir Mihailenco
2019-08-08 10:36:13 +03:00
parent 056ad27792
commit 2927e15b6b
9 changed files with 61 additions and 37 deletions

View File

@ -6,13 +6,12 @@ import (
"net"
"strings"
"github.com/go-redis/redis/internal/pool"
"github.com/go-redis/redis/internal/proto"
)
func isRetryableError(err error, retryTimeout bool) bool {
switch err {
case nil, context.Canceled, context.DeadlineExceeded, pool.ErrBadConn:
case nil, context.Canceled, context.DeadlineExceeded:
return false
case io.EOF:
return true
@ -49,8 +48,6 @@ func isBadConn(err error, allowTimeout bool) bool {
switch err {
case nil:
return false
case pool.ErrBadConn:
return true
}
if isRedisError(err) {
return isReadOnlyError(err) // #790