forked from MirrorHub/mautrix-whatsapp
backfill queue: interrupt sending to deferred channel on queue re-check
If a queue re-check is requested, interrupt sending the backfill request to the deferred channel so that immediate backfills can happen ASAP.
This commit is contained in:
parent
89131bd20c
commit
3096786454
1 changed files with 8 additions and 1 deletions
|
@ -40,7 +40,14 @@ func (bq *BackfillQueue) RunLoop(user *User) {
|
|||
if backfill.BackfillType == database.BackfillImmediate || backfill.BackfillType == database.BackfillForward {
|
||||
bq.ImmediateBackfillRequests <- backfill
|
||||
} else {
|
||||
bq.DeferredBackfillRequests <- backfill
|
||||
select {
|
||||
case <-bq.ReCheckQueue:
|
||||
// If a queue re-check is requested, interrupt sending the
|
||||
// backfill request to the deferred channel so that
|
||||
// immediate backfills can happen ASAP.
|
||||
continue
|
||||
case bq.DeferredBackfillRequests <- backfill:
|
||||
}
|
||||
}
|
||||
backfill.MarkDone()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue