mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Add another check for stopped scraper.
This commit is contained in:
parent
5678a86924
commit
16a1a6d324
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue