diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index c4364f731..d68835b6c 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -164,15 +164,20 @@ func (t *tieredStorage) Serve() { var ( flushMemoryTicker = time.Tick(t.flushMemoryInterval) writeMemoryTicker = time.Tick(t.writeMemoryInterval) + stopReport = make(chan bool) ) + defer func() { close(stopReport) }() go func() { reportTicker := time.Tick(time.Second) for { - <-reportTicker - - t.reportQueues() + select { + case <-reportTicker: + t.reportQueues() + case <-stopReport: + return + } } }()