aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorTill Faelligen <2353100+S7evinK@users.noreply.github.com>2023-03-06 17:58:08 +0100
committerTill Faelligen <2353100+S7evinK@users.noreply.github.com>2023-03-06 17:58:08 +0100
commit11a3fcc6cbaa7368b4360ba5cd88e48633a31da0 (patch)
tree1868b53eed4a8286a32e4965c11287f765acf779 /internal
parenta684b850b9dccc12121c6ff314c1ecd660f8c9a2 (diff)
RoomServerEvents are mutable, given they can be redacted
Diffstat (limited to 'internal')
-rw-r--r--internal/caching/impl_ristretto.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/caching/impl_ristretto.go b/internal/caching/impl_ristretto.go
index fca93afd..106b9c99 100644
--- a/internal/caching/impl_ristretto.go
+++ b/internal/caching/impl_ristretto.go
@@ -22,11 +22,12 @@ import (
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
- "github.com/matrix-org/dendrite/roomserver/types"
- "github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/gomatrixserverlib"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
+
+ "github.com/matrix-org/dendrite/roomserver/types"
+ "github.com/matrix-org/dendrite/setup/config"
)
const (
@@ -98,9 +99,10 @@ func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enableProm
},
RoomServerEvents: &RistrettoCostedCachePartition[int64, *gomatrixserverlib.Event]{ // event NID -> event
&RistrettoCachePartition[int64, *gomatrixserverlib.Event]{
- cache: cache,
- Prefix: roomEventsCache,
- MaxAge: maxAge,
+ cache: cache,
+ Prefix: roomEventsCache,
+ MaxAge: maxAge,
+ Mutable: true,
},
},
RoomServerStateKeys: &RistrettoCachePartition[types.EventStateKeyNID, string]{ // event NID -> event state key