Speed up start up time by batch querying ACL events (#3334)

This should significantly speed up start up times on servers with many
rooms.
This commit is contained in:
Till 2024-02-21 14:10:22 +01:00 committed by GitHub
parent 8f944f6434
commit f4e77453cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 23 deletions

View file

@ -24,6 +24,7 @@ import (
"fmt"
"time"
"github.com/matrix-org/dendrite/roomserver/storage/tables"
"github.com/tidwall/gjson"
"github.com/matrix-org/gomatrixserverlib"
@ -509,7 +510,13 @@ func (r *Inputer) processRoomEvent(
logrus.WithError(err).Error("failed to get server ACLs")
}
if aclEvent != nil {
r.ACLs.OnServerACLUpdate(aclEvent)
strippedEvent := tables.StrippedEvent{
RoomID: aclEvent.RoomID().String(),
EventType: aclEvent.Type(),
StateKey: *aclEvent.StateKey(),
ContentValue: string(aclEvent.Content()),
}
r.ACLs.OnServerACLUpdate(strippedEvent)
}
}
}