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:
5
error.go
5
error.go
@ -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
|
||||
|
Reference in New Issue
Block a user