routing: only log topology client sends if clients are active

This commit is contained in:
Olaoluwa Osuntokun 2017-03-16 12:16:24 -07:00
parent 57a7d58ef9
commit d0509955a7
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -107,12 +107,14 @@ type topologyClient struct {
// notifyTopologyChange notifies all registered clients of a new change in // notifyTopologyChange notifies all registered clients of a new change in
// graph topology in a non-blocking. // graph topology in a non-blocking.
func (r *ChannelRouter) notifyTopologyChange(topologyDiff *TopologyChange) { func (r *ChannelRouter) notifyTopologyChange(topologyDiff *TopologyChange) {
if len(r.topologyClients) != 0 {
log.Tracef("Sending topology notification to %v clients %v", log.Tracef("Sending topology notification to %v clients %v",
len(r.topologyClients), len(r.topologyClients),
newLogClosure(func() string { newLogClosure(func() string {
return spew.Sdump(topologyDiff) return spew.Sdump(topologyDiff)
}), }),
) )
}
for _, client := range r.topologyClients { for _, client := range r.topologyClients {
go func(c topologyClient) { go func(c topologyClient) {