mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-21 04:53:14 -06:00
Add debug logging
This commit is contained in:
parent
8246b20d85
commit
296184c789
|
|
@ -114,17 +114,18 @@ func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msgs []*nats.Msg
|
||||||
WantMembership: "join",
|
WantMembership: "join",
|
||||||
}, &queryRes)
|
}, &queryRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("failed to calculate joined rooms for user")
|
log.WithError(err).Error("::: failed to calculate joined rooms for user")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
joined, err = t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true)
|
joined, err = t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("failed to get joined hosts")
|
log.WithError(err).Error("::: failed to get joined hosts")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(joined) == 0 {
|
if len(joined) == 0 {
|
||||||
|
log.Debugf("::: no joined hosts, retrying (%d/%d)", i+1, maxRetries)
|
||||||
time.Sleep(retryDelay)
|
time.Sleep(retryDelay)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -132,6 +133,7 @@ func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msgs []*nats.Msg
|
||||||
}
|
}
|
||||||
// If we still have no joined hosts, discard the event.
|
// If we still have no joined hosts, discard the event.
|
||||||
if len(joined) == 0 {
|
if len(joined) == 0 {
|
||||||
|
log.Debugf("::: no joined hosts after retrying")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue