From 1eb77b8161cdf2e3b107c606d4f3f88209042ed8 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Mon, 1 Jul 2019 16:04:49 +0100 Subject: [PATCH] Don't print Sending EDU if there is noone to send to (#721) The logs had a lot of: ``` Sending EDU event destinations="[]" edu_type=m.typing ``` Which is useless if it isn't actually sending the event anywhere (destinations is empty). --- federationsender/queue/queue.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/federationsender/queue/queue.go b/federationsender/queue/queue.go index 4a38dc086..6a05c5f07 100644 --- a/federationsender/queue/queue.go +++ b/federationsender/queue/queue.go @@ -96,9 +96,11 @@ func (oqs *OutgoingQueues) SendEDU( // Remove our own server from the list of destinations. destinations = filterDestinations(oqs.origin, destinations) - log.WithFields(log.Fields{ - "destinations": destinations, "edu_type": e.Type, - }).Info("Sending EDU event") + if len(destinations) > 0 { + log.WithFields(log.Fields{ + "destinations": destinations, "edu_type": e.Type, + }).Info("Sending EDU event") + } oqs.queuesMutex.Lock() defer oqs.queuesMutex.Unlock()