Skip to content

Commit

Permalink
Merge pull request #1751 from turetske/ticker_fix
Browse files Browse the repository at this point in the history
Fixes an issue where a misplaced `defer ticker.Stop()` stopped the re…
  • Loading branch information
jhiemstrawisc authored Nov 18, 2024
2 parents 334dc74 + 48e18b5 commit cbcc668
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions launcher_utils/advertise.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func LaunchPeriodicAdvertise(ctx context.Context, egrp *errgroup.Group, servers
doAdvertise(ctx, servers)

ticker := time.NewTicker(1 * time.Minute)
defer ticker.Stop()
egrp.Go(func() error {

defer ticker.Stop()
for {
select {
case <-ticker.C:
Expand Down

0 comments on commit cbcc668

Please sign in to comment.