Skip to content

Commit a39fcc3

Browse files
authored
delete goroutine wait
1 parent bed5c07 commit a39fcc3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

sentinel.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,9 @@ func (c *sentinelFailover) MasterAddr(ctx context.Context) (string, error) {
601601
}(i, sentinelAddr)
602602

603603
}
604-
go func() {
605-
wg.Wait()
606-
once.Do(func() {
607-
close(done)
608-
})
609-
}()
610-
<-done
604+
defer close(done)
605+
wg.Wait()
606+
611607
if masterAddr != "" {
612608
return masterAddr, nil
613609
}

0 commit comments

Comments
 (0)