1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Add TxPipeline.

This commit is contained in:
Vladimir Mihailenco
2016-12-13 17:28:39 +02:00
parent c6acf2ed15
commit 865d501d07
13 changed files with 577 additions and 590 deletions

View File

@ -381,10 +381,6 @@ func (c *Ring) pipelineExec(cmds []Cmder) (firstErr error) {
var failedCmdsMap map[string][]Cmder
for name, cmds := range cmdsMap {
if i > 0 {
resetCmds(cmds)
}
shard, err := c.shardByName(name)
if err != nil {
setCmdsErr(cmds, err)
@ -403,7 +399,7 @@ func (c *Ring) pipelineExec(cmds []Cmder) (firstErr error) {
continue
}
retry, err := shard.Client.execCmds(cn, cmds)
canRetry, err := shard.Client.pipelineProcessCmds(cn, cmds)
shard.Client.putConn(cn, err, false)
if err == nil {
continue
@ -411,7 +407,7 @@ func (c *Ring) pipelineExec(cmds []Cmder) (firstErr error) {
if firstErr == nil {
firstErr = err
}
if retry {
if canRetry && internal.IsRetryableError(err) {
if failedCmdsMap == nil {
failedCmdsMap = make(map[string][]Cmder)
}