Unnecessary go routine spawn. (#7879)
* Unnecessary go routine spawn. * Remove unnecessary local variable creation. Signed-off-by: iurii <iurii@coins.ph> Co-authored-by: iurii <iurii@coins.ph>
This commit is contained in:
parent
2255b6f62f
commit
bd53b5ff37
|
@ -373,7 +373,7 @@ func (sp *scrapePool) reload(cfg *config.ScrapeConfig) error {
|
|||
wg.Done()
|
||||
|
||||
newLoop.setForcedError(forcedErr)
|
||||
go newLoop.run(interval, timeout, nil)
|
||||
newLoop.run(interval, timeout, nil)
|
||||
}(oldLoop, newLoop)
|
||||
|
||||
sp.loops[fp] = newLoop
|
||||
|
@ -435,7 +435,6 @@ func (sp *scrapePool) sync(targets []*Target) {
|
|||
)
|
||||
|
||||
for _, t := range targets {
|
||||
t := t
|
||||
hash := t.hash()
|
||||
|
||||
if _, ok := sp.activeTargets[hash]; !ok {
|
||||
|
|
Loading…
Reference in New Issue