mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Define const for max cache entries
This commit is contained in:
parent
3ca36e1319
commit
a101b3a713
|
|
@ -2,6 +2,10 @@ package caching
|
|||
|
||||
import "github.com/matrix-org/gomatrixserverlib"
|
||||
|
||||
const (
|
||||
MaxRoomVersionCacheEntries = 128
|
||||
)
|
||||
|
||||
type Cache interface {
|
||||
GetRoomVersion(roomId string) (gomatrixserverlib.RoomVersion, bool)
|
||||
StoreRoomVersion(roomId string, roomVersion gomatrixserverlib.RoomVersion)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type InMemoryLRUCache struct {
|
|||
}
|
||||
|
||||
func NewInMemoryLRUCache() (*InMemoryLRUCache, error) {
|
||||
roomVersionCache, rvErr := lru.New(128)
|
||||
roomVersionCache, rvErr := lru.New(MaxRoomVersionCacheEntries)
|
||||
if rvErr != nil {
|
||||
return nil, rvErr
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue