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:
parent
8f944f6434
commit
f4e77453cb
5 changed files with 43 additions and 23 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue