Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/tracing

This commit is contained in:
Till Faelligen 2023-03-08 10:39:16 +01:00
commit e44951e460
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 8 additions and 8 deletions

View file

@ -22,11 +22,12 @@ import (
"github.com/dgraph-io/ristretto" "github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z" "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/matrix-org/gomatrixserverlib"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/dendrite/setup/config"
) )
const ( const (
@ -101,6 +102,7 @@ func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enableProm
cache: cache, cache: cache,
Prefix: roomEventsCache, Prefix: roomEventsCache,
MaxAge: maxAge, MaxAge: maxAge,
Mutable: true,
}, },
}, },
RoomServerStateKeys: &RistrettoCachePartition[types.EventStateKeyNID, string]{ // event NID -> event state key RoomServerStateKeys: &RistrettoCachePartition[types.EventStateKeyNID, string]{ // event NID -> event state key

View file

@ -133,9 +133,6 @@ func (r *Backfiller) backfillViaFederation(ctx context.Context, req *api.Perform
// persist these new events - auth checks have already been done // persist these new events - auth checks have already been done
roomNID, backfilledEventMap := persistEvents(ctx, r.DB, events) roomNID, backfilledEventMap := persistEvents(ctx, r.DB, events)
if err != nil {
return err
}
for _, ev := range backfilledEventMap { for _, ev := range backfilledEventMap {
// now add state for these events // 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") logrus.WithError(err).Error("failed to get or create roomNID")
continue continue
} }
roomNID = roomInfo.RoomNID
eventTypeNID, err := db.GetOrCreateEventTypeNID(ctx, ev.Type()) eventTypeNID, err := db.GetOrCreateEventTypeNID(ctx, ev.Type())
if err != nil { if err != nil {