mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Try to backfill via federation in error cases
This commit is contained in:
parent
a763cbb0e1
commit
ae7919c2cf
1 changed files with 6 additions and 3 deletions
|
@ -79,21 +79,24 @@ func (r *Backfiller) PerformBackfill(
|
|||
// Scan the event tree for events to send back.
|
||||
resultNIDs, err := helpers.ScanEventTree(ctx, r.DB, info, front, visited, request.Limit, request.ServerName)
|
||||
if err != nil {
|
||||
return err
|
||||
return r.backfillViaFederation(ctx, request, response)
|
||||
}
|
||||
|
||||
// Retrieve events from the list that was filled previously.
|
||||
var loadedEvents []*gomatrixserverlib.Event
|
||||
loadedEvents, err = helpers.LoadEvents(ctx, r.DB, resultNIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
return r.backfillViaFederation(ctx, request, response)
|
||||
}
|
||||
|
||||
for _, event := range loadedEvents {
|
||||
response.Events = append(response.Events, event.Headered(info.RoomVersion))
|
||||
}
|
||||
|
||||
return err
|
||||
if err != nil {
|
||||
return r.backfillViaFederation(ctx, request, response)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Backfiller) backfillViaFederation(ctx context.Context, req *api.PerformBackfillRequest, res *api.PerformBackfillResponse) error {
|
||||
|
|
Loading…
Reference in a new issue