mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Close of reportTicker to exit goroutine.
This commit is contained in:
parent
5043c6fce7
commit
22da76e8ab
|
@ -164,20 +164,13 @@ func (t *tieredStorage) Serve() {
|
|||
var (
|
||||
flushMemoryTicker = time.Tick(t.flushMemoryInterval)
|
||||
writeMemoryTicker = time.Tick(t.writeMemoryInterval)
|
||||
stopReport = make(chan bool)
|
||||
reportTicker = time.NewTicker(time.Second)
|
||||
)
|
||||
defer func() { close(stopReport) }()
|
||||
defer reportTicker.Stop()
|
||||
|
||||
go func() {
|
||||
reportTicker := time.Tick(time.Second)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-reportTicker:
|
||||
t.reportQueues()
|
||||
case <-stopReport:
|
||||
return
|
||||
}
|
||||
for _ = range reportTicker.C {
|
||||
t.reportQueues()
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in a new issue