mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +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.scrapersStarted.Inc()
|
||||
sg.wg.Add(1)
|
||||
go func() {
|
||||
tsmGlobal.Register(sw)
|
||||
go func(sw *ScrapeWork) {
|
||||
defer sg.wg.Done()
|
||||
sc.sw.run(sc.stopCh)
|
||||
tsmGlobal.Unregister(sw)
|
||||
sg.activeScrapers.Dec()
|
||||
sg.scrapersStopped.Inc()
|
||||
}()
|
||||
tsmGlobal.Register(sw)
|
||||
}(sw)
|
||||
sg.m[key] = sc
|
||||
additionsCount++
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue