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

Close connection on network timeout.

This commit is contained in:
Vladimir Mihailenco
2016-03-08 17:18:52 +02:00
parent 0ea1bdd306
commit 673e999431
8 changed files with 19 additions and 30 deletions

View File

@ -32,7 +32,6 @@ type Cmder interface {
setErr(error)
reset()
writeTimeout() *time.Duration
readTimeout() *time.Duration
clusterKey() string
@ -82,7 +81,7 @@ type baseCmd struct {
_clusterKeyPos int
_writeTimeout, _readTimeout *time.Duration
_readTimeout *time.Duration
}
func (cmd *baseCmd) Err() error {
@ -104,10 +103,6 @@ func (cmd *baseCmd) setReadTimeout(d time.Duration) {
cmd._readTimeout = &d
}
func (cmd *baseCmd) writeTimeout() *time.Duration {
return cmd._writeTimeout
}
func (cmd *baseCmd) clusterKey() string {
if cmd._clusterKeyPos > 0 && cmd._clusterKeyPos < len(cmd._args) {
return fmt.Sprint(cmd._args[cmd._clusterKeyPos])
@ -115,10 +110,6 @@ func (cmd *baseCmd) clusterKey() string {
return ""
}
func (cmd *baseCmd) setWriteTimeout(d time.Duration) {
cmd._writeTimeout = &d
}
func (cmd *baseCmd) setErr(e error) {
cmd.err = e
}