|
@@ -58,15 +58,17 @@ func (user *User) handleHistorySyncsLoop() {
|
|
log: user.log.Sub("BackfillQueue"),
|
|
log: user.log.Sub("BackfillQueue"),
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ forwardAndImmediate := []database.BackfillType{database.BackfillImmediate, database.BackfillForward}
|
|
|
|
+
|
|
// Immediate backfills can be done in parallel
|
|
// Immediate backfills can be done in parallel
|
|
for i := 0; i < user.bridge.Config.Bridge.HistorySync.Immediate.WorkerCount; i++ {
|
|
for i := 0; i < user.bridge.Config.Bridge.HistorySync.Immediate.WorkerCount; i++ {
|
|
- go user.HandleBackfillRequestsLoop([]database.BackfillType{database.BackfillImmediate, database.BackfillForward})
|
|
|
|
|
|
+ go user.HandleBackfillRequestsLoop(forwardAndImmediate, []database.BackfillType{})
|
|
}
|
|
}
|
|
|
|
|
|
// Deferred backfills should be handled synchronously so as not to
|
|
// Deferred backfills should be handled synchronously so as not to
|
|
// overload the homeserver. Users can configure their backfill stages
|
|
// overload the homeserver. Users can configure their backfill stages
|
|
// to be more or less aggressive with backfilling at this stage.
|
|
// to be more or less aggressive with backfilling at this stage.
|
|
- go user.HandleBackfillRequestsLoop([]database.BackfillType{database.BackfillDeferred})
|
|
|
|
|
|
+ go user.HandleBackfillRequestsLoop([]database.BackfillType{database.BackfillDeferred}, forwardAndImmediate)
|
|
|
|
|
|
if user.bridge.Config.Bridge.HistorySync.MediaRequests.AutoRequestMedia &&
|
|
if user.bridge.Config.Bridge.HistorySync.MediaRequests.AutoRequestMedia &&
|
|
user.bridge.Config.Bridge.HistorySync.MediaRequests.RequestMethod == config.MediaRequestMethodLocalTime {
|
|
user.bridge.Config.Bridge.HistorySync.MediaRequests.RequestMethod == config.MediaRequestMethodLocalTime {
|
|
@@ -733,7 +735,7 @@ func (portal *Portal) updateBackfillStatus(backfillState *database.BackfillState
|
|
"first_timestamp": backfillState.FirstExpectedTimestamp,
|
|
"first_timestamp": backfillState.FirstExpectedTimestamp,
|
|
})
|
|
})
|
|
if err != nil {
|
|
if err != nil {
|
|
- portal.log.Errorln("Error sending post-backfill dummy event:", err)
|
|
|
|
|
|
+ portal.log.Errorln("Error sending backfill status dummy event:", err)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|