mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
tm-monitor: update health after we added / removed node (#2694)
Refs #2693
This commit is contained in:
parent
6643c5dd11
commit
bbf15b3d09
@ -140,14 +140,22 @@ func (n *Network) NodeIsOnline(name string) {
|
||||
|
||||
// NewNode is called when the new node is added to the monitor.
|
||||
func (n *Network) NewNode(name string) {
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
|
||||
n.NumNodesMonitored++
|
||||
n.NumNodesMonitoredOnline++
|
||||
n.updateHealth()
|
||||
}
|
||||
|
||||
// NodeDeleted is called when the node is deleted from under the monitor.
|
||||
func (n *Network) NodeDeleted(name string) {
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
|
||||
n.NumNodesMonitored--
|
||||
n.NumNodesMonitoredOnline--
|
||||
n.updateHealth()
|
||||
}
|
||||
|
||||
func (n *Network) updateHealth() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user