mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -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"
|
||||||
"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 (
|
||||||
|
|
@ -98,9 +99,10 @@ func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enableProm
|
||||||
},
|
},
|
||||||
RoomServerEvents: &RistrettoCostedCachePartition[int64, *gomatrixserverlib.Event]{ // event NID -> event
|
RoomServerEvents: &RistrettoCostedCachePartition[int64, *gomatrixserverlib.Event]{ // event NID -> event
|
||||||
&RistrettoCachePartition[int64, *gomatrixserverlib.Event]{
|
&RistrettoCachePartition[int64, *gomatrixserverlib.Event]{
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue