diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-10-05 12:47:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 12:47:53 +0100 |
commit | c85bc3434fc930423e9e27c8bca9b31b5ad7a441 (patch) | |
tree | a0957de84c44143571cd785d4794c7a979d02b53 /syncapi | |
parent | 6f602bb0969fac6d455de1088bf3980f77a4017f (diff) |
Optimise `QuerySharedUsers` so that we can only work on local users (#2766)
Otherwise the sync API key change consumer wastes a lot of time trying
to wake up the notifiers for non-local users.
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/consumers/keychange.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/syncapi/consumers/keychange.go b/syncapi/consumers/keychange.go index dc7d9e20..96ebba7e 100644 --- a/syncapi/consumers/keychange.go +++ b/syncapi/consumers/keychange.go @@ -111,7 +111,8 @@ func (s *OutputKeyChangeEventConsumer) onDeviceKeyMessage(m api.DeviceMessage, d // work out who we need to notify about the new key var queryRes roomserverAPI.QuerySharedUsersResponse err := s.rsAPI.QuerySharedUsers(s.ctx, &roomserverAPI.QuerySharedUsersRequest{ - UserID: output.UserID, + UserID: output.UserID, + LocalOnly: true, }, &queryRes) if err != nil { logrus.WithError(err).Error("syncapi: failed to QuerySharedUsers for key change event from key server") @@ -135,7 +136,8 @@ func (s *OutputKeyChangeEventConsumer) onCrossSigningMessage(m api.DeviceMessage // work out who we need to notify about the new key var queryRes roomserverAPI.QuerySharedUsersResponse err := s.rsAPI.QuerySharedUsers(s.ctx, &roomserverAPI.QuerySharedUsersRequest{ - UserID: output.UserID, + UserID: output.UserID, + LocalOnly: true, }, &queryRes) if err != nil { logrus.WithError(err).Error("syncapi: failed to QuerySharedUsers for key change event from key server") |