mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promscrape: consistency renaming: stopCh -> globalStopCh
This commit is contained in:
parent
032c88561b
commit
9a944fd169
1 changed files with 5 additions and 5 deletions
|
@ -24,23 +24,23 @@ var (
|
|||
//
|
||||
// Scraped data is passed to pushData.
|
||||
func Init(pushData func(wr *prompbmarshal.WriteRequest)) {
|
||||
stopCh = make(chan struct{})
|
||||
globalStopCh = make(chan struct{})
|
||||
scraperWG.Add(1)
|
||||
go func() {
|
||||
defer scraperWG.Done()
|
||||
runScraper(*promscrapeConfigFile, pushData, stopCh)
|
||||
runScraper(*promscrapeConfigFile, pushData, globalStopCh)
|
||||
}()
|
||||
}
|
||||
|
||||
// Stop stops Prometheus scraper.
|
||||
func Stop() {
|
||||
close(stopCh)
|
||||
close(globalStopCh)
|
||||
scraperWG.Wait()
|
||||
}
|
||||
|
||||
var (
|
||||
stopCh chan struct{}
|
||||
scraperWG sync.WaitGroup
|
||||
globalStopCh chan struct{}
|
||||
scraperWG sync.WaitGroup
|
||||
)
|
||||
|
||||
func runScraper(configFile string, pushData func(wr *prompbmarshal.WriteRequest), globalStopCh <-chan struct{}) {
|
||||
|
|
Loading…
Reference in a new issue