balancer/weightedroundrobin: fix ticker leak on update (#6643)

This commit is contained in:
Antoine Tollenaere 2023-09-18 20:34:50 +02:00 committed by GitHub
parent 92f5ba9783
commit 1457a96132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -369,6 +369,7 @@ func (p *picker) start(ctx context.Context) {
}
go func() {
ticker := time.NewTicker(time.Duration(p.cfg.WeightUpdatePeriod))
defer ticker.Stop()
for {
select {
case <-ctx.Done():