Skip to content

Commit

Permalink
Silence presence logs (matrix-org#2547)
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK authored Jun 30, 2022
1 parent 519bc11 commit 561c159
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion federationapi/consumers/presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msg *nats.Msg) b
return true
}

log.Debugf("sending presence EDU to %d servers", len(joined))
log.Tracef("sending presence EDU to %d servers", len(joined))
if err = t.queues.SendEDU(edu, t.ServerName, joined); err != nil {
log.WithError(err).Error("failed to send EDU")
return false
Expand Down
2 changes: 1 addition & 1 deletion federationapi/producers/syncapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (p *SyncAPIProducer) SendPresence(
lastActiveTS := gomatrixserverlib.AsTimestamp(time.Now().Add(-(time.Duration(lastActiveAgo) * time.Millisecond)))

m.Header.Set("last_active_ts", strconv.Itoa(int(lastActiveTS)))
log.Debugf("Sending presence to syncAPI: %+v", m.Header)
log.Tracef("Sending presence to syncAPI: %+v", m.Header)
_, err := p.JetStream.PublishMsg(m, nats.Context(ctx))
return err
}
Expand Down
2 changes: 1 addition & 1 deletion syncapi/consumers/presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (s *PresenceConsumer) onMessage(ctx context.Context, msg *nats.Msg) bool {
presence := msg.Header.Get("presence")
timestamp := msg.Header.Get("last_active_ts")
fromSync, _ := strconv.ParseBool(msg.Header.Get("from_sync"))
logrus.Debugf("syncAPI received presence event: %+v", msg.Header)
logrus.Tracef("syncAPI received presence event: %+v", msg.Header)

if fromSync { // do not process local presence changes; we already did this synchronously.
return true
Expand Down
2 changes: 1 addition & 1 deletion syncapi/streams/stream_presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (p *PresenceStreamProvider) IncrementalSync(
currentlyActive := prevPresence.CurrentlyActive()
skip := prevPresence.Equals(presence) && currentlyActive && req.Device.UserID != presence.UserID
if skip {
req.Log.Debugf("Skipping presence, no change (%s)", presence.UserID)
req.Log.Tracef("Skipping presence, no change (%s)", presence.UserID)
continue
}
}
Expand Down

0 comments on commit 561c159

Please sign in to comment.