mirror of https://github.com/grpc/grpc-go.git
balancer/weightedroundrobin: fix ticker leak on update (#6643)
This commit is contained in:
parent
92f5ba9783
commit
1457a96132
|
|
@ -369,6 +369,7 @@ func (p *picker) start(ctx context.Context) {
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
ticker := time.NewTicker(time.Duration(p.cfg.WeightUpdatePeriod))
|
ticker := time.NewTicker(time.Duration(p.cfg.WeightUpdatePeriod))
|
||||||
|
defer ticker.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue