diff --git a/internal/caching/cache_space_rooms.go b/internal/caching/cache_space_rooms.go index 71b81abc..6d56cce5 100644 --- a/internal/caching/cache_space_rooms.go +++ b/internal/caching/cache_space_rooms.go @@ -1,11 +1,16 @@ package caching -import "github.com/matrix-org/gomatrixserverlib" +import ( + "time" + + "github.com/matrix-org/gomatrixserverlib" +) const ( SpaceSummaryRoomsCacheName = "space_summary_rooms" SpaceSummaryRoomsCacheMaxEntries = 100 SpaceSummaryRoomsCacheMutable = true + SpaceSummaryRoomsCacheMaxAge = time.Minute * 5 ) type SpaceSummaryRoomsCache interface { diff --git a/internal/caching/impl_inmemorylru.go b/internal/caching/impl_inmemorylru.go index c9c8fd08..94fdd1a9 100644 --- a/internal/caching/impl_inmemorylru.go +++ b/internal/caching/impl_inmemorylru.go @@ -64,6 +64,7 @@ func NewInMemoryLRUCache(enablePrometheus bool) (*Caches, error) { SpaceSummaryRoomsCacheName, SpaceSummaryRoomsCacheMutable, SpaceSummaryRoomsCacheMaxEntries, + SpaceSummaryRoomsCacheMaxAge, enablePrometheus, ) if err != nil {