diff options
Diffstat (limited to 'internal/caching')
-rw-r--r-- | internal/caching/cache_roomevents.go | 9 | ||||
-rw-r--r-- | internal/caching/caches.go | 2 | ||||
-rw-r--r-- | internal/caching/impl_ristretto.go | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/internal/caching/cache_roomevents.go b/internal/caching/cache_roomevents.go index 14b6c3af..e8bbe208 100644 --- a/internal/caching/cache_roomevents.go +++ b/internal/caching/cache_roomevents.go @@ -2,22 +2,21 @@ package caching import ( "github.com/matrix-org/dendrite/roomserver/types" - "github.com/matrix-org/gomatrixserverlib" ) // RoomServerEventsCache contains the subset of functions needed for // a roomserver event cache. type RoomServerEventsCache interface { - GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) - StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) + GetRoomServerEvent(eventNID types.EventNID) (*types.HeaderedEvent, bool) + StoreRoomServerEvent(eventNID types.EventNID, event *types.HeaderedEvent) InvalidateRoomServerEvent(eventNID types.EventNID) } -func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) { +func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*types.HeaderedEvent, bool) { return c.RoomServerEvents.Get(int64(eventNID)) } -func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) { +func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *types.HeaderedEvent) { c.RoomServerEvents.Set(int64(eventNID), event) } diff --git a/internal/caching/caches.go b/internal/caching/caches.go index f4bbea78..6bae60d5 100644 --- a/internal/caching/caches.go +++ b/internal/caching/caches.go @@ -28,7 +28,7 @@ type Caches struct { ServerKeys Cache[string, gomatrixserverlib.PublicKeyLookupResult] // server name -> server keys RoomServerRoomNIDs Cache[string, types.RoomNID] // room ID -> room NID RoomServerRoomIDs Cache[types.RoomNID, string] // room NID -> room ID - RoomServerEvents Cache[int64, *gomatrixserverlib.Event] // event NID -> event + RoomServerEvents Cache[int64, *types.HeaderedEvent] // event NID -> event RoomServerStateKeys Cache[types.EventStateKeyNID, string] // eventStateKey NID -> event state key RoomServerStateKeyNIDs Cache[string, types.EventStateKeyNID] // event state key -> eventStateKey NID RoomServerEventTypeNIDs Cache[string, types.EventTypeNID] // eventType -> eventType NID diff --git a/internal/caching/impl_ristretto.go b/internal/caching/impl_ristretto.go index 247eec61..00989b76 100644 --- a/internal/caching/impl_ristretto.go +++ b/internal/caching/impl_ristretto.go @@ -103,8 +103,8 @@ func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enableProm Prefix: roomIDsCache, MaxAge: maxAge, }, - RoomServerEvents: &RistrettoCostedCachePartition[int64, *gomatrixserverlib.Event]{ // event NID -> event - &RistrettoCachePartition[int64, *gomatrixserverlib.Event]{ + RoomServerEvents: &RistrettoCostedCachePartition[int64, *types.HeaderedEvent]{ // event NID -> event + &RistrettoCachePartition[int64, *types.HeaderedEvent]{ cache: cache, Prefix: roomEventsCache, MaxAge: maxAge, |