Skip to content

Commit 50f12a1

Browse files
authored
Merge pull request #1574 from go-redis/fix/wait-goroutine-to-finish
Wait for the goroutine to finish
2 parents 2e398ad + 2c9c526 commit 50f12a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

redis.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ func (c *baseClient) withConn(
316316
select {
317317
case <-done:
318318
_ = cn.Close()
319+
// Wait for the goroutine to finish and send something.
320+
<-errc
319321

320322
err = ctx.Err()
321323
return err

0 commit comments

Comments
 (0)