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>
pull/7886/head
iurii 4 years ago committed by GitHub
parent 2255b6f62f
commit bd53b5ff37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save