aboutsummaryrefslogtreecommitdiff
path: root/internal/caching/impl_inmemorylru.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-05-06 15:33:34 +0200
committerGitHub <noreply@github.com>2022-05-06 15:33:34 +0200
commit6493c0c0f23bb930cc8a2ce071a66b7d4b5ec9eb (patch)
treead4beb518a4f25542b0dcebe7e8efc95220c337c /internal/caching/impl_inmemorylru.go
parent507f63d0fc8158f200f3e29fd36e5f09c83e62db (diff)
Move LL cache (#2429)
Diffstat (limited to 'internal/caching/impl_inmemorylru.go')
-rw-r--r--internal/caching/impl_inmemorylru.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/internal/caching/impl_inmemorylru.go b/internal/caching/impl_inmemorylru.go
index 94fdd1a9..59476089 100644
--- a/internal/caching/impl_inmemorylru.go
+++ b/internal/caching/impl_inmemorylru.go
@@ -70,9 +70,21 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) {
if err != nil {
return nil, err
}
+
+ lazyLoadCache, err := NewInMemoryLRUCachePartition(
+ LazyLoadCacheName,
+ LazyLoadCacheMutable,
+ LazyLoadCacheMaxEntries,
+ LazyLoadCacheMaxAge,
+ enablePrometheus,
+ )
+ if err != nil {
+ return nil, err
+ }
+
go cacheCleaner(
roomVersions, serverKeys, roomServerRoomIDs,
- roomInfos, federationEvents, spaceRooms,
+ roomInfos, federationEvents, spaceRooms, lazyLoadCache,
)
return &Caches{
RoomVersions: roomVersions,
@@ -81,6 +93,7 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) {
RoomInfos: roomInfos,
FederationEvents: federationEvents,
SpaceSummaryRooms: spaceRooms,
+ LazyLoading: lazyLoadCache,
}, nil
}