diff options
Diffstat (limited to 'internal/caching/impl_inmemorylru.go')
-rw-r--r-- | internal/caching/impl_inmemorylru.go | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/internal/caching/impl_inmemorylru.go b/internal/caching/impl_inmemorylru.go index 7bb791dd..e99c18d7 100644 --- a/internal/caching/impl_inmemorylru.go +++ b/internal/caching/impl_inmemorylru.go @@ -27,9 +27,49 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) { if err != nil { return nil, err } + roomServerStateKeyNIDs, err := NewInMemoryLRUCachePartition( + RoomServerStateKeyNIDsCacheName, + RoomServerStateKeyNIDsCacheMutable, + RoomServerStateKeyNIDsCacheMaxEntries, + enablePrometheus, + ) + if err != nil { + return nil, err + } + roomServerEventTypeNIDs, err := NewInMemoryLRUCachePartition( + RoomServerEventTypeNIDsCacheName, + RoomServerEventTypeNIDsCacheMutable, + RoomServerEventTypeNIDsCacheMaxEntries, + enablePrometheus, + ) + if err != nil { + return nil, err + } + roomServerRoomNIDs, err := NewInMemoryLRUCachePartition( + RoomServerRoomNIDsCacheName, + RoomServerRoomNIDsCacheMutable, + RoomServerRoomNIDsCacheMaxEntries, + enablePrometheus, + ) + if err != nil { + return nil, err + } + roomServerRoomIDs, err := NewInMemoryLRUCachePartition( + RoomServerRoomIDsCacheName, + RoomServerRoomIDsCacheMutable, + RoomServerRoomIDsCacheMaxEntries, + enablePrometheus, + ) + if err != nil { + return nil, err + } return &Caches{ - RoomVersions: roomVersions, - ServerKeys: serverKeys, + RoomVersions: roomVersions, + ServerKeys: serverKeys, + RoomServerStateKeyNIDs: roomServerStateKeyNIDs, + RoomServerEventTypeNIDs: roomServerEventTypeNIDs, + RoomServerRoomNIDs: roomServerRoomNIDs, + RoomServerRoomIDs: roomServerRoomIDs, }, nil } |