Unnecessary go routine spawn. (#7951)

Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
This commit is contained in:
李国忠 2020-09-21 18:29:03 +08:00 committed by GitHub
parent 7aa5fb01bf
commit 4a52faf2ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -954,14 +954,12 @@ func (m *Manager) Update(interval time.Duration, files []string, externalLabels
oldg.stop() oldg.stop()
newg.CopyState(oldg) newg.CopyState(oldg)
} }
go func() { wg.Done()
// Wait with starting evaluation until the rule manager // Wait with starting evaluation until the rule manager
// is told to run. This is necessary to avoid running // is told to run. This is necessary to avoid running
// queries against a bootstrapping storage. // queries against a bootstrapping storage.
<-m.block <-m.block
newg.run(m.opts.Context) newg.run(m.opts.Context)
}()
wg.Done()
}(newg) }(newg)
} }