mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Implement key caching directly (#1038)
* Use gomatrixserverlib key caching * Implement key caching wrapper * Add caching wrapper in BaseComponent * Review comments
This commit is contained in:
parent
7ca230e931
commit
419ff150d4
7 changed files with 108 additions and 27 deletions
|
@ -25,6 +25,7 @@ import (
|
|||
|
||||
"github.com/matrix-org/dendrite/common/caching"
|
||||
"github.com/matrix-org/dendrite/common/keydb"
|
||||
"github.com/matrix-org/dendrite/common/keydb/cache"
|
||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/naffka"
|
||||
|
@ -186,7 +187,11 @@ func (b *BaseDendrite) CreateKeyDB() keydb.Database {
|
|||
logrus.WithError(err).Panicf("failed to connect to keys db")
|
||||
}
|
||||
|
||||
return db
|
||||
cachedDB, err := cache.NewKeyDatabase(db, b.ImmutableCache)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Panicf("failed to create key cache wrapper")
|
||||
}
|
||||
return cachedDB
|
||||
}
|
||||
|
||||
// CreateFederationClient creates a new federation client. Should only be called
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue