Make node join event logging less noisy
Commit ca9a768d80
added a number of debugging messages for node join/leave
events.
This patch checks if a node already was listed,
and otherwise skips the logging to make the logs a bit
less noisy.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d01e1d38c3
commit
3dd1fb1217
|
@ -111,9 +111,12 @@ func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
|
|||
switch nEvent.Type {
|
||||
case NodeEventTypeJoin:
|
||||
nDB.Lock()
|
||||
_, found := nDB.nodes[n.Name]
|
||||
nDB.nodes[n.Name] = n
|
||||
nDB.Unlock()
|
||||
logrus.Infof("Node join event for %s/%s", n.Name, n.Addr)
|
||||
if !found {
|
||||
logrus.Infof("Node join event for %s/%s", n.Name, n.Addr)
|
||||
}
|
||||
return true
|
||||
case NodeEventTypeLeave:
|
||||
nDB.Lock()
|
||||
|
|
Loading…
Reference in New Issue