mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-26 05:31:32 +00:00
Try federation when backfill fails to find events in the database (#2113)
* Try to backfill via federation in error cases * Cleaner retry for backfill * Simpler condition
This commit is contained in:
parent
a763cbb0e1
commit
b6011d0d87
@ -82,10 +82,14 @@ func (r *Backfiller) PerformBackfill(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve events from the list that was filled previously.
|
// Retrieve events from the list that was filled previously. If we fail to get
|
||||||
|
// events from the database then attempt once to get them from federation instead.
|
||||||
var loadedEvents []*gomatrixserverlib.Event
|
var loadedEvents []*gomatrixserverlib.Event
|
||||||
loadedEvents, err = helpers.LoadEvents(ctx, r.DB, resultNIDs)
|
loadedEvents, err = helpers.LoadEvents(ctx, r.DB, resultNIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if _, ok := err.(types.MissingEventError); ok {
|
||||||
|
return r.backfillViaFederation(ctx, request, response)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user