mirror of https://github.com/prometheus/prometheus
Close of reportTicker to exit goroutine.
parent
5043c6fce7
commit
22da76e8ab
|
@ -164,20 +164,13 @@ func (t *tieredStorage) Serve() {
|
||||||
var (
|
var (
|
||||||
flushMemoryTicker = time.Tick(t.flushMemoryInterval)
|
flushMemoryTicker = time.Tick(t.flushMemoryInterval)
|
||||||
writeMemoryTicker = time.Tick(t.writeMemoryInterval)
|
writeMemoryTicker = time.Tick(t.writeMemoryInterval)
|
||||||
stopReport = make(chan bool)
|
reportTicker = time.NewTicker(time.Second)
|
||||||
)
|
)
|
||||||
defer func() { close(stopReport) }()
|
defer reportTicker.Stop()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
reportTicker := time.Tick(time.Second)
|
for _ = range reportTicker.C {
|
||||||
|
t.reportQueues()
|
||||||
for {
|
|
||||||
select {
|
|
||||||
case <-reportTicker:
|
|
||||||
t.reportQueues()
|
|
||||||
case <-stopReport:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue