fix mongodb input concurrent map read/write

closes #1211
This commit is contained in:
Kane Dou
2016-05-17 18:02:51 +08:00
committed by Cameron Sparr
parent b065573e23
commit 1dbe3b8231
2 changed files with 4 additions and 3 deletions

View File

@@ -69,10 +69,10 @@ func (m *MongoDB) Gather(acc telegraf.Accumulator) error {
}
}
wg.Add(1)
go func() {
go func(srv *Server) {
defer wg.Done()
outerr = m.gatherServer(m.getMongoServer(u), acc)
}()
outerr = m.gatherServer(srv, acc)
}(m.getMongoServer(u))
}
wg.Wait()