aboutsummaryrefslogtreecommitdiff
path: root/internal/caching/cache_space_rooms.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caching/cache_space_rooms.go')
-rw-r--r--internal/caching/cache_space_rooms.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/internal/caching/cache_space_rooms.go b/internal/caching/cache_space_rooms.go
index 6d56cce5..697f9926 100644
--- a/internal/caching/cache_space_rooms.go
+++ b/internal/caching/cache_space_rooms.go
@@ -1,31 +1,16 @@
package caching
import (
- "time"
-
"github.com/matrix-org/gomatrixserverlib"
)
-const (
- SpaceSummaryRoomsCacheName = "space_summary_rooms"
- SpaceSummaryRoomsCacheMaxEntries = 100
- SpaceSummaryRoomsCacheMutable = true
- SpaceSummaryRoomsCacheMaxAge = time.Minute * 5
-)
-
type SpaceSummaryRoomsCache interface {
GetSpaceSummary(roomID string) (r gomatrixserverlib.MSC2946SpacesResponse, ok bool)
StoreSpaceSummary(roomID string, r gomatrixserverlib.MSC2946SpacesResponse)
}
func (c Caches) GetSpaceSummary(roomID string) (r gomatrixserverlib.MSC2946SpacesResponse, ok bool) {
- val, found := c.SpaceSummaryRooms.Get(roomID)
- if found && val != nil {
- if resp, ok := val.(gomatrixserverlib.MSC2946SpacesResponse); ok {
- return resp, true
- }
- }
- return r, false
+ return c.SpaceSummaryRooms.Get(roomID)
}
func (c Caches) StoreSpaceSummary(roomID string, r gomatrixserverlib.MSC2946SpacesResponse) {