mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Simplify connection management with sticky connection pool. Fixes #260.
This commit is contained in:
12
error.go
12
error.go
@ -33,14 +33,14 @@ func isNetworkError(err error) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func isBadConn(cn *conn, ei error) bool {
|
||||
if cn.rd.Buffered() > 0 {
|
||||
return true
|
||||
}
|
||||
if ei == nil {
|
||||
func isBadConn(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
if _, ok := ei.(redisError); ok {
|
||||
if _, ok := err.(redisError); ok {
|
||||
return false
|
||||
}
|
||||
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
Reference in New Issue
Block a user