diff --git a/internal/caching/cache_roomservernids.go b/internal/caching/cache_roomservernids.go index d1d306d17..da6d19b5a 100644 --- a/internal/caching/cache_roomservernids.go +++ b/internal/caching/cache_roomservernids.go @@ -25,9 +25,9 @@ type RoomServerNIDsCache interface { } func (c Caches) GetRoomServerRoomID(roomNID types.RoomNID) (string, bool) { - return c.RoomServerRoomIDs.Get(roomNID) + return c.RoomServerRoomIDs.Get(int64(roomNID)) } func (c Caches) StoreRoomServerRoomID(roomNID types.RoomNID, roomID string) { - c.RoomServerRoomIDs.Set(roomNID, roomID) + c.RoomServerRoomIDs.Set(int64(roomNID), roomID) } diff --git a/internal/caching/caches.go b/internal/caching/caches.go index 4d94e7321..1b456717c 100644 --- a/internal/caching/caches.go +++ b/internal/caching/caches.go @@ -14,7 +14,7 @@ type Caches struct { RoomVersions Cache[string, gomatrixserverlib.RoomVersion] ServerKeys Cache[string, gomatrixserverlib.PublicKeyLookupResult] RoomServerRoomNIDs Cache[string, types.RoomNID] - RoomServerRoomIDs Cache[types.RoomNID, string] + RoomServerRoomIDs Cache[int64, string] RoomInfos Cache[string, types.RoomInfo] FederationPDUs Cache[int64, *gomatrixserverlib.HeaderedEvent] FederationEDUs Cache[int64, *gomatrixserverlib.EDU] @@ -31,7 +31,7 @@ type Cache[K keyable, T any] interface { type keyable interface { // from https://github.com/dgraph-io/ristretto/blob/8e850b710d6df0383c375ec6a7beae4ce48fc8d5/z/z.go#L34 - ~uint64 | ~string | ~[]byte | ~byte | ~int | ~int32 | ~uint32 | ~int64 + uint64 | string | []byte | byte | int | int32 | uint32 | int64 } type costable interface { diff --git a/internal/caching/impl_ristretto.go b/internal/caching/impl_ristretto.go index 291b07335..0758b5dbb 100644 --- a/internal/caching/impl_ristretto.go +++ b/internal/caching/impl_ristretto.go @@ -38,7 +38,7 @@ func NewRistrettoCache(maxCost CacheSize, enablePrometheus bool) (*Caches, error Name: "server_keys", Mutable: true, }, - RoomServerRoomIDs: &RistrettoCachePartition[types.RoomNID, string]{ + RoomServerRoomIDs: &RistrettoCachePartition[int64, string]{ cache: cache, Name: "room_ids", },