diff options
author | kegsay <kegan@matrix.org> | 2022-03-01 16:32:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 16:32:48 +0000 |
commit | 352e63915f110cbe4907349a7e59f43f179657e6 (patch) | |
tree | 4d157f398c78ee0cfa3f597f9218cca01f2f4a6d /internal/caching/impl_inmemorylru.go | |
parent | ae840590b643bd74786f3e8a869a8ea9e769995b (diff) |
msc2946: add federation cache (#2238)
Diffstat (limited to 'internal/caching/impl_inmemorylru.go')
-rw-r--r-- | internal/caching/impl_inmemorylru.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/caching/impl_inmemorylru.go b/internal/caching/impl_inmemorylru.go index ccb92852..7b21f136 100644 --- a/internal/caching/impl_inmemorylru.go +++ b/internal/caching/impl_inmemorylru.go @@ -55,9 +55,18 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) { if err != nil { return nil, err } + spaceRooms, err := NewInMemoryLRUCachePartition( + SpaceSummaryRoomsCacheName, + SpaceSummaryRoomsCacheMutable, + SpaceSummaryRoomsCacheMaxEntries, + enablePrometheus, + ) + if err != nil { + return nil, err + } go cacheCleaner( roomVersions, serverKeys, roomServerRoomIDs, - roomInfos, federationEvents, + roomInfos, federationEvents, spaceRooms, ) return &Caches{ RoomVersions: roomVersions, @@ -65,6 +74,7 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) { RoomServerRoomIDs: roomServerRoomIDs, RoomInfos: roomInfos, FederationEvents: federationEvents, + SpaceSummaryRooms: spaceRooms, }, nil } |