mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Fix that some more
This commit is contained in:
parent
e614269bc3
commit
800dbbf9e4
|
|
@ -25,9 +25,9 @@ type RoomServerNIDsCache interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Caches) GetRoomServerRoomID(roomNID types.RoomNID) (string, bool) {
|
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) {
|
func (c Caches) StoreRoomServerRoomID(roomNID types.RoomNID, roomID string) {
|
||||||
c.RoomServerRoomIDs.Set(roomNID, roomID)
|
c.RoomServerRoomIDs.Set(int64(roomNID), roomID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ type Caches struct {
|
||||||
RoomVersions Cache[string, gomatrixserverlib.RoomVersion]
|
RoomVersions Cache[string, gomatrixserverlib.RoomVersion]
|
||||||
ServerKeys Cache[string, gomatrixserverlib.PublicKeyLookupResult]
|
ServerKeys Cache[string, gomatrixserverlib.PublicKeyLookupResult]
|
||||||
RoomServerRoomNIDs Cache[string, types.RoomNID]
|
RoomServerRoomNIDs Cache[string, types.RoomNID]
|
||||||
RoomServerRoomIDs Cache[types.RoomNID, string]
|
RoomServerRoomIDs Cache[int64, string]
|
||||||
RoomInfos Cache[string, types.RoomInfo]
|
RoomInfos Cache[string, types.RoomInfo]
|
||||||
FederationPDUs Cache[int64, *gomatrixserverlib.HeaderedEvent]
|
FederationPDUs Cache[int64, *gomatrixserverlib.HeaderedEvent]
|
||||||
FederationEDUs Cache[int64, *gomatrixserverlib.EDU]
|
FederationEDUs Cache[int64, *gomatrixserverlib.EDU]
|
||||||
|
|
@ -31,7 +31,7 @@ type Cache[K keyable, T any] interface {
|
||||||
|
|
||||||
type keyable interface {
|
type keyable interface {
|
||||||
// from https://github.com/dgraph-io/ristretto/blob/8e850b710d6df0383c375ec6a7beae4ce48fc8d5/z/z.go#L34
|
// 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 {
|
type costable interface {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ func NewRistrettoCache(maxCost CacheSize, enablePrometheus bool) (*Caches, error
|
||||||
Name: "server_keys",
|
Name: "server_keys",
|
||||||
Mutable: true,
|
Mutable: true,
|
||||||
},
|
},
|
||||||
RoomServerRoomIDs: &RistrettoCachePartition[types.RoomNID, string]{
|
RoomServerRoomIDs: &RistrettoCachePartition[int64, string]{
|
||||||
cache: cache,
|
cache: cache,
|
||||||
Name: "room_ids",
|
Name: "room_ids",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue