mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Add some more logging
This commit is contained in:
parent
44c52a2482
commit
ece014ddfe
1 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/element-hq/dendrite/roomserver/storage/tables"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue