Limit the number of servers we attempt to reduce backpressure

This commit is contained in:
Neil Alexander 2022-01-24 13:57:03 +00:00
parent d0ee9f9841
commit 8a2c565385
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -135,6 +135,9 @@ func (r *Inputer) processRoomEvent(
if input.Origin != "" {
serverRes.ServerNames = append([]gomatrixserverlib.ServerName{input.Origin}, serverRes.ServerNames...)
}
if len(serverRes.ServerNames) > 5 {
serverRes.ServerNames = serverRes.ServerNames[:5]
}
// First of all, check that the auth events of the event are known.
// If they aren't then we will ask the federation API for them.