Skip to content

Commit

Permalink
Add some more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Dec 19, 2024
1 parent 44c52a2 commit ece014d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roomserver/acls/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"regexp"
"strings"
"sync"
"time"

"github.com/element-hq/dendrite/roomserver/storage/tables"
"github.com/matrix-org/gomatrixserverlib"
Expand All @@ -40,6 +41,16 @@ type ServerACLs struct {
}

func NewServerACLs(db ServerACLDatabase) *ServerACLs {
// Add some logging, as this can take a while.
logrus.Infof("Loading server ACLs")
start := time.Now()
aclCount := 0
defer func() {
logrus.WithFields(logrus.Fields{
"duration": time.Since(start),
"acls": aclCount,
}).Info("Finished loading server ACLs")
}()
ctx := context.TODO()
acls := &ServerACLs{
acls: make(map[string]*serverACL),
Expand All @@ -62,6 +73,8 @@ func NewServerACLs(db ServerACLDatabase) *ServerACLs {
logrus.WithError(err).Errorf("Failed to get server ACLs for all rooms: %q", err)
}

aclCount = len(events)

for _, event := range events {
acls.OnServerACLUpdate(event)
}
Expand Down

0 comments on commit ece014d

Please sign in to comment.