Hopefully fix backfilling

This commit is contained in:
Till Faelligen 2023-01-03 09:09:26 +01:00
parent 8d207b7a97
commit f182fd7ee3
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 3 additions and 1 deletions

View file

@ -83,7 +83,7 @@ func Backfill(
"": eIDs, "": eIDs,
}, },
ServerName: request.Origin(), ServerName: request.Origin(),
VirtualHost: request.Origin(), VirtualHost: request.Destination(),
} }
if req.Limit, err = strconv.Atoi(limit); err != nil { if req.Limit, err = strconv.Atoi(limit); err != nil {
util.GetLogger(httpReq.Context()).WithError(err).Error("strconv.Atoi failed") util.GetLogger(httpReq.Context()).WithError(err).Error("strconv.Atoi failed")

View file

@ -56,6 +56,7 @@ func (r *Backfiller) PerformBackfill(
// TODO: we could be more sensible and fetch as many events we already have then request the rest // TODO: we could be more sensible and fetch as many events we already have then request the rest
// which is what the syncapi does already. // which is what the syncapi does already.
if r.IsLocalServerName(request.ServerName) { if r.IsLocalServerName(request.ServerName) {
logrus.Debugf("backfilling via federation: %+v", request)
return r.backfillViaFederation(ctx, request, response) return r.backfillViaFederation(ctx, request, response)
} }
// someone else is requesting the backfill, try to service their request. // someone else is requesting the backfill, try to service their request.
@ -319,6 +320,7 @@ FederationHit:
FedClient: b.fsAPI, FedClient: b.fsAPI,
RememberAuthEvents: false, RememberAuthEvents: false,
Server: srv, Server: srv,
Origin: b.virtualHost,
} }
res, err := c.StateIDsBeforeEvent(ctx, targetEvent) res, err := c.StateIDsBeforeEvent(ctx, targetEvent)
if err != nil { if err != nil {