From f54063a61af8223d8d6d99ab789029dd4b99d7b2 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 30 Jun 2021 09:58:33 +0100 Subject: [PATCH] Use only origin server to speed things up --- federationapi/routing/send.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index b67612c5..6275ee37 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -466,21 +466,23 @@ func (t *txnReq) processDeviceListUpdate(ctx context.Context, e gomatrixserverli } } -func (t *txnReq) getServers(ctx context.Context, roomID string) []gomatrixserverlib.ServerName { +func (t *txnReq) getServers(_ context.Context, _ string) []gomatrixserverlib.ServerName { t.serversMutex.Lock() defer t.serversMutex.Unlock() if t.servers != nil { return t.servers } t.servers = []gomatrixserverlib.ServerName{t.Origin} - serverReq := &api.QueryServerJoinedToRoomRequest{ - RoomID: roomID, - } - serverRes := &api.QueryServerJoinedToRoomResponse{} - if err := t.rsAPI.QueryServerJoinedToRoom(ctx, serverReq, serverRes); err == nil { - t.servers = append(t.servers, serverRes.ServerNames...) - util.GetLogger(ctx).Infof("Found %d server(s) to query for missing events in %q", len(t.servers), roomID) - } + /* + serverReq := &api.QueryServerJoinedToRoomRequest{ + RoomID: roomID, + } + serverRes := &api.QueryServerJoinedToRoomResponse{} + if err := t.rsAPI.QueryServerJoinedToRoom(ctx, serverReq, serverRes); err == nil { + t.servers = append(t.servers, serverRes.ServerNames...) + util.GetLogger(ctx).Infof("Found %d server(s) to query for missing events in %q", len(t.servers), roomID) + } + */ return t.servers }