Merge pull request #1574 from go-redis/fix/wait-goroutine-to-finish

Wait for the goroutine to finish
This commit is contained in:
Vladimir Mihailenco 2020-12-06 17:27:38 +02:00 committed by GitHub
commit 50f12a149b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -316,6 +316,8 @@ func (c *baseClient) withConn(
select { select {
case <-done: case <-done:
_ = cn.Close() _ = cn.Close()
// Wait for the goroutine to finish and send something.
<-errc
err = ctx.Err() err = ctx.Err()
return err return err