Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: go/src/infra/monitoring/dispatcher/dispatcher.go

Issue 1996863003: alerts_dispatcher: Fix bad tree selection logic. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/monitoring/dispatcher/dispatcher.go
diff --git a/go/src/infra/monitoring/dispatcher/dispatcher.go b/go/src/infra/monitoring/dispatcher/dispatcher.go
index d39a3d217626850eb3c5aa29ead2e387d76e9c19..77ac18bc0d173029470d6431548b1c75ca6d40bb 100644
--- a/go/src/infra/monitoring/dispatcher/dispatcher.go
+++ b/go/src/infra/monitoring/dispatcher/dispatcher.go
@@ -156,21 +156,16 @@ func mainLoop(ctx context.Context, a *analyzer.Analyzer, trees map[string]bool,
done := make(chan interface{})
errs := make(chan error)
for treeName := range trees {
- go func(tree string) {
+ tree := treeName
seanmccullough1 2016/05/20 18:40:29 ha!
+ go func() {
expvars.Add(fmt.Sprintf("Tree-%s", tree), 1)
defer expvars.Add(fmt.Sprintf("Tree-%s", tree), -1)
infoLog.Printf("Checking tree: %s", tree)
masters := []*messages.MasterLocation{}
- for treeToUse, shouldUse := range trees {
- if !shouldUse {
- continue
- }
-
- for _, t := range gkts[treeToUse] {
- for _, url := range t.Masters {
- masters = append(masters, url)
- }
+ for _, t := range gkts[tree] {
+ for _, url := range t.Masters {
+ masters = append(masters, url)
}
}
@@ -233,7 +228,7 @@ func mainLoop(ctx context.Context, a *analyzer.Analyzer, trees map[string]bool,
infoLog.Printf("Filtered failures: %v", filteredFailures)
done <- nil
- }(treeName)
+ }()
}
for range trees {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698