Add another check for stopped scraper.

This commit is contained in:
beorn7 2015-02-06 18:30:33 +01:00
parent 5678a86924
commit 16a1a6d324

View file

@ -277,6 +277,13 @@ func (t *target) RunScraper(ingester extraction.Ingester, interval time.Duration
// actual scrape interval increase as long as a scrape takes
// longer than the interval we are aiming for.
time.Sleep(took - interval)
// After the sleep, we should check again if we have been stopped.
select {
case <-t.scraperStopping:
return
default:
// Do nothing.
}
t.scrape(ingester)
}
}