mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/tracing
This commit is contained in:
commit
e44951e460
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -133,9 +133,6 @@ func (r *Backfiller) backfillViaFederation(ctx context.Context, req *api.Perform
|
|||
|
||||
// persist these new events - auth checks have already been done
|
||||
roomNID, backfilledEventMap := persistEvents(ctx, r.DB, events)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, ev := range backfilledEventMap {
|
||||
// now add state for these events
|
||||
|
|
@ -611,6 +608,7 @@ func persistEvents(ctx context.Context, db storage.Database, events []*gomatrixs
|
|||
logrus.WithError(err).Error("failed to get or create roomNID")
|
||||
continue
|
||||
}
|
||||
roomNID = roomInfo.RoomNID
|
||||
|
||||
eventTypeNID, err := db.GetOrCreateEventTypeNID(ctx, ev.Type())
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue