mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-16 14:12:24 +03:00
Speed up loading ACLs on startup (#3469)
Currently d.m.org struggles to start, as it is fetching several thousand ACLs on startup. The reason is that we're loading the entire room state into memory, only to filter out the majority of it, because we only care about certain types. This change filters the types (tuples) directly when querying the database, so we don't end up with unneeded state.
This commit is contained in:
parent
294f3d2a10
commit
add73ec866
4 changed files with 89 additions and 14 deletions
|
@ -187,6 +187,8 @@ type Database interface {
|
|||
|
||||
// RoomsWithACLs returns all room IDs for rooms with ACLs
|
||||
RoomsWithACLs(ctx context.Context) ([]string, error)
|
||||
// GetBulkStateACLs returns all server ACLs for the given rooms.
|
||||
GetBulkStateACLs(ctx context.Context, roomIDs []string) ([]tables.StrippedEvent, error)
|
||||
QueryAdminEventReports(ctx context.Context, from uint64, limit uint64, backwards bool, userID string, roomID string) ([]api.QueryAdminEventReportsResponse, int64, error)
|
||||
QueryAdminEventReport(ctx context.Context, reportID uint64) (api.QueryAdminEventReportResponse, error)
|
||||
AdminDeleteEventReport(ctx context.Context, reportID uint64) error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue