diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-02-18 10:58:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 10:58:41 +0000 |
commit | 131bedc1a11135eb1f67a26389fe8f53c82c537d (patch) | |
tree | 1c66c0fde3098629948198c1d7262e559fd24921 /internal/caching/impl_inmemorylru.go | |
parent | e1eb5807b66940490291983be905f2849539aa7f (diff) |
Remove event type and state key caches (#2200)
* Don't proactively cache event types and state keys when we don't know if the transaction has persisted yet
* Remove event type and state key caches altogether
Diffstat (limited to 'internal/caching/impl_inmemorylru.go')
-rw-r--r-- | internal/caching/impl_inmemorylru.go | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/internal/caching/impl_inmemorylru.go b/internal/caching/impl_inmemorylru.go index f0915d7c..ccb92852 100644 --- a/internal/caching/impl_inmemorylru.go +++ b/internal/caching/impl_inmemorylru.go @@ -28,24 +28,6 @@ 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 - } roomServerRoomIDs, err := NewInMemoryLRUCachePartition( RoomServerRoomIDsCacheName, RoomServerRoomIDsCacheMutable, @@ -74,18 +56,15 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) { return nil, err } go cacheCleaner( - roomVersions, serverKeys, roomServerStateKeyNIDs, - roomServerEventTypeNIDs, roomServerRoomIDs, + roomVersions, serverKeys, roomServerRoomIDs, roomInfos, federationEvents, ) return &Caches{ - RoomVersions: roomVersions, - ServerKeys: serverKeys, - RoomServerStateKeyNIDs: roomServerStateKeyNIDs, - RoomServerEventTypeNIDs: roomServerEventTypeNIDs, - RoomServerRoomIDs: roomServerRoomIDs, - RoomInfos: roomInfos, - FederationEvents: federationEvents, + RoomVersions: roomVersions, + ServerKeys: serverKeys, + RoomServerRoomIDs: roomServerRoomIDs, + RoomInfos: roomInfos, + FederationEvents: federationEvents, }, nil } |