Skip to content

Commit

Permalink
Terminate timeloop faster for m3 (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
artms authored Oct 10, 2022
1 parent 86b6b09 commit 734a7ff
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 @@ -692,9 +692,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 734a7ff

Please sign in to comment.