Merge pull request #2242 from go-redis/fix/pipeline-dial-retry

fix: retry dial errors from pipelines
This commit is contained in:
Vladimir Mihailenco 2022-10-11 09:53:01 +03:00 committed by GitHub
commit 3676fa2a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -413,7 +413,8 @@ func (c *baseClient) _generalProcessPipeline(
} }
} }
var canRetry bool // Enable retries by default to retry dial errors returned by withConn.
canRetry := true
lastErr = c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error { lastErr = c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
var err error var err error
canRetry, err = p(ctx, cn, cmds) canRetry, err = p(ctx, cn, cmds)