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:
Sumner Evans 2022-04-30 01:03:53 -06:00
parent 89131bd20c
commit 3096786454
No known key found for this signature in database
GPG key ID: 8904527AB50022FD

View file

@ -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 {