diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-03-01 16:59:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 16:59:52 +0000 |
commit | bb2380c254b65a6586137e9e0ab9e08354aa19f4 (patch) | |
tree | c2840dc80cccd762f0037ee79cb7f778d20388f6 /internal/caching/cache_roominfo.go | |
parent | 726529fe996519c93f4f329c03a968a432b0bb0e (diff) |
Allow specifying max age for caches (#2239)
* Allow specifying max age for caches
* Evict cache entry if it's found to be stale when we call Get
* Fix bugs
Diffstat (limited to 'internal/caching/cache_roominfo.go')
-rw-r--r-- | internal/caching/cache_roominfo.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/caching/cache_roominfo.go b/internal/caching/cache_roominfo.go index f32d6ba9..60d22128 100644 --- a/internal/caching/cache_roominfo.go +++ b/internal/caching/cache_roominfo.go @@ -1,6 +1,8 @@ package caching import ( + "time" + "github.com/matrix-org/dendrite/roomserver/types" ) @@ -16,6 +18,7 @@ const ( RoomInfoCacheName = "roominfo" RoomInfoCacheMaxEntries = 1024 RoomInfoCacheMutable = true + RoomInfoCacheMaxAge = time.Minute * 5 ) // RoomInfosCache contains the subset of functions needed for |