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 {
|
switch nEvent.Type {
|
||||||
case NodeEventTypeJoin:
|
case NodeEventTypeJoin:
|
||||||
nDB.Lock()
|
nDB.Lock()
|
||||||
|
_, found := nDB.nodes[n.Name]
|
||||||
nDB.nodes[n.Name] = n
|
nDB.nodes[n.Name] = n
|
||||||
nDB.Unlock()
|
nDB.Unlock()
|
||||||
|
if !found {
|
||||||
logrus.Infof("Node join event for %s/%s", n.Name, n.Addr)
|
logrus.Infof("Node join event for %s/%s", n.Name, n.Addr)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
case NodeEventTypeLeave:
|
case NodeEventTypeLeave:
|
||||||
nDB.Lock()
|
nDB.Lock()
|
||||||
|
|
Loading…
Reference in New Issue