mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/promscrape: properly remove deleted target from /targets
page
Previously `sw` variable wasn't captured correctly by the started goroutine.
This commit is contained in:
parent
49e800ba55
commit
c4ec977934
1 changed files with 3 additions and 3 deletions
|
@ -318,14 +318,14 @@ func (sg *scraperGroup) update(sws []*ScrapeWork) {
|
||||||
sg.activeScrapers.Inc()
|
sg.activeScrapers.Inc()
|
||||||
sg.scrapersStarted.Inc()
|
sg.scrapersStarted.Inc()
|
||||||
sg.wg.Add(1)
|
sg.wg.Add(1)
|
||||||
go func() {
|
tsmGlobal.Register(sw)
|
||||||
|
go func(sw *ScrapeWork) {
|
||||||
defer sg.wg.Done()
|
defer sg.wg.Done()
|
||||||
sc.sw.run(sc.stopCh)
|
sc.sw.run(sc.stopCh)
|
||||||
tsmGlobal.Unregister(sw)
|
tsmGlobal.Unregister(sw)
|
||||||
sg.activeScrapers.Dec()
|
sg.activeScrapers.Dec()
|
||||||
sg.scrapersStopped.Inc()
|
sg.scrapersStopped.Inc()
|
||||||
}()
|
}(sw)
|
||||||
tsmGlobal.Register(sw)
|
|
||||||
sg.m[key] = sc
|
sg.m[key] = sc
|
||||||
additionsCount++
|
additionsCount++
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue