Skip to content

Commit

Permalink
Terminate timeloop faster for m3 (uber-go#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
artms authored and brawndou committed Nov 17, 2022
1 parent 34f53e7 commit a8f2d97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion m3/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,15 @@ func (r *reporter) reportInternalMetrics() {
}

func (r *reporter) timeLoop() {
t := time.NewTicker(_timeResolution)
defer t.Stop()
for !r.done.Load() {
r.now.Store(time.Now().UnixNano())
time.Sleep(_timeResolution)
select {
case <-t.C:
case <-r.donech:
return
}
}
}

Expand Down

0 comments on commit a8f2d97

Please sign in to comment.