From 99ea84f0fdaa2528732d620c5ac874b42ff0ac6b Mon Sep 17 00:00:00 2001 From: helen Date: Thu, 1 Feb 2024 01:50:36 +0800 Subject: [PATCH] clean unused code (#5735) Signed-off-by: helen --- lib/promscrape/scraper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/promscrape/scraper.go b/lib/promscrape/scraper.go index ad6319203..183dcd0e1 100644 --- a/lib/promscrape/scraper.go +++ b/lib/promscrape/scraper.go @@ -410,7 +410,7 @@ func (sg *scraperGroup) update(sws []*ScrapeWork) { sg.scrapersStarted.Inc() sg.wg.Add(1) tsmGlobal.Register(&sc.sw) - go func(sw *ScrapeWork) { + go func() { defer func() { sg.wg.Done() close(sc.stoppedCh) @@ -419,7 +419,7 @@ func (sg *scraperGroup) update(sws []*ScrapeWork) { tsmGlobal.Unregister(&sc.sw) sg.activeScrapers.Dec() sg.scrapersStopped.Inc() - }(sw) + }() key := sw.key() sg.m[key] = sc additionsCount++