Close of reportTicker to exit goroutine.

pull/187/head
Johannes 'fish' Ziemke 2013-04-25 13:04:45 +02:00
parent 5043c6fce7
commit 22da76e8ab
1 changed files with 4 additions and 11 deletions

View File

@ -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 {
for {
select {
case <-reportTicker:
t.reportQueues() t.reportQueues()
case <-stopReport:
return
}
} }
}() }()