1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Conn timeout should be higher than read timeout

This commit is contained in:
Vladimir Mihailenco
2018-07-22 08:49:48 +03:00
parent ee41b90923
commit b92dacbfa7
4 changed files with 8 additions and 9 deletions

View File

@ -1274,7 +1274,7 @@ func (c *ClusterClient) remapCmds(cmds []Cmder, failedCmds map[*clusterNode][]Cm
func (c *ClusterClient) pipelineProcessCmds(
node *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds map[*clusterNode][]Cmder,
) error {
_ = cn.SetWriteTimeout(c.opt.WriteTimeout)
cn.SetWriteTimeout(c.opt.WriteTimeout)
err := writeCmd(cn, cmds...)
if err != nil {
@ -1284,7 +1284,7 @@ func (c *ClusterClient) pipelineProcessCmds(
}
// Set read timeout for all commands.
_ = cn.SetReadTimeout(c.opt.ReadTimeout)
cn.SetReadTimeout(c.opt.ReadTimeout)
return c.pipelineReadCmds(cn, cmds, failedCmds)
}