Hold rmut read lock when looking at nodeStatRefs
This commit is contained in:
parent
75b26513e1
commit
cf1bfdfb61
@ -209,9 +209,11 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
|
||||
// Returns statistics about each node
|
||||
func (m *Model) NodeStatistics() map[string]stats.NodeStatistics {
|
||||
var res = make(map[string]stats.NodeStatistics)
|
||||
m.rmut.RLock()
|
||||
for _, node := range m.cfg.Nodes {
|
||||
res[node.NodeID.String()] = m.nodeStatRefs[node.NodeID].GetStatistics()
|
||||
}
|
||||
m.rmut.RUnlock()
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user