From 4a52faf2ae36999fcdec973e75c176e3883a6e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=9B=BD=E5=BF=A0?= Date: Mon, 21 Sep 2020 18:29:03 +0800 Subject: [PATCH] Unnecessary go routine spawn. (#7951) Signed-off-by: fuling --- rules/manager.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rules/manager.go b/rules/manager.go index b1002339a7..476f628517 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -954,14 +954,12 @@ func (m *Manager) Update(interval time.Duration, files []string, externalLabels oldg.stop() newg.CopyState(oldg) } - go func() { - // Wait with starting evaluation until the rule manager - // is told to run. This is necessary to avoid running - // queries against a bootstrapping storage. - <-m.block - newg.run(m.opts.Context) - }() wg.Done() + // Wait with starting evaluation until the rule manager + // is told to run. This is necessary to avoid running + // queries against a bootstrapping storage. + <-m.block + newg.run(m.opts.Context) }(newg) }