Skip to content

Commit

Permalink
Add another check for stopped scraper.
Browse files Browse the repository at this point in the history
  • Loading branch information
beorn7 committed Feb 6, 2015
1 parent 5678a86 commit 16a1a6d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions retrieval/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 16a1a6d

Please sign in to comment.