Some guards

This commit is contained in:
Neil Alexander 2022-06-14 16:52:27 +01:00
parent c4c2c9d0ff
commit 3f9617e373
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 6 additions and 3 deletions

View file

@ -54,6 +54,7 @@ func NewRistrettoCache(maxCost CacheSize, enablePrometheus bool) (*Caches, error
RoomServerEvents: &RistrettoCachePartition[int64, *gomatrixserverlib.Event]{
cache: cache,
Name: "room_events",
Mutable: true,
},
RoomInfos: &RistrettoCachePartition[string, types.RoomInfo]{
cache: cache,

View file

@ -493,8 +493,10 @@ func (d *Database) events(
if err != nil {
return nil, err
}
if result.Event != nil {
d.Cache.StoreRoomServerEvent(result.EventNID, result.Event)
}
}
if !redactionsArePermanent {
d.applyRedactions(results)
}