aboutsummaryrefslogtreecommitdiff
path: root/federationapi/consumers/keychange.go
diff options
context:
space:
mode:
authorS7evinK <2353100+S7evinK@users.noreply.github.com>2022-02-09 15:46:52 +0100
committerGitHub <noreply@github.com>2022-02-09 15:46:52 +0100
commitcc688a9a386f48e38687a697b50f9be7d2b06fb0 (patch)
tree959a14800479af19a9aeca2d6ab0d40699cf7f86 /federationapi/consumers/keychange.go
parentac25065a54149117761e7a1b471a9b742f920ebc (diff)
Avoid unnecessary logs and marshaling (#2167)
Co-authored-by: kegsay <kegan@matrix.org>
Diffstat (limited to 'federationapi/consumers/keychange.go')
-rw-r--r--federationapi/consumers/keychange.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/federationapi/consumers/keychange.go b/federationapi/consumers/keychange.go
index 1ec9f4c1..22dbc32d 100644
--- a/federationapi/consumers/keychange.go
+++ b/federationapi/consumers/keychange.go
@@ -127,6 +127,9 @@ func (t *KeyChangeConsumer) onDeviceKeyMessage(m api.DeviceMessage) bool {
return true
}
+ if len(destinations) == 0 {
+ return true
+ }
// Pack the EDU and marshal it
edu := &gomatrixserverlib.EDU{
Type: gomatrixserverlib.MDeviceListUpdate,
@@ -146,7 +149,7 @@ func (t *KeyChangeConsumer) onDeviceKeyMessage(m api.DeviceMessage) bool {
return true
}
- logger.Infof("Sending device list update message to %q", destinations)
+ logger.Debugf("Sending device list update message to %q", destinations)
err = t.queues.SendEDU(edu, t.serverName, destinations)
return err == nil
}
@@ -181,6 +184,10 @@ func (t *KeyChangeConsumer) onCrossSigningMessage(m api.DeviceMessage) bool {
return true
}
+ if len(destinations) == 0 {
+ return true
+ }
+
// Pack the EDU and marshal it
edu := &gomatrixserverlib.EDU{
Type: eduserverAPI.MSigningKeyUpdate,
@@ -191,7 +198,7 @@ func (t *KeyChangeConsumer) onCrossSigningMessage(m api.DeviceMessage) bool {
return true
}
- logger.Infof("Sending cross-signing update message to %q", destinations)
+ logger.Debugf("Sending cross-signing update message to %q", destinations)
err = t.queues.SendEDU(edu, t.serverName, destinations)
return err == nil
}