fix mongodb input concurrent map read/write
This commit is contained in:
parent
a7b632eb5e
commit
0d5f95bbef
|
@ -69,10 +69,10 @@ func (m *MongoDB) Gather(acc telegraf.Accumulator) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func(srv *Server) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
outerr = m.gatherServer(m.getMongoServer(u), acc)
|
outerr = m.gatherServer(srv, acc)
|
||||||
}()
|
}(m.getMongoServer(u))
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Reference in New Issue