This commit is contained in:
Half-Shot 2024-02-06 16:15:40 +00:00
parent e3d085e5d6
commit 4274eb41a6

View File

@ -39,7 +39,7 @@ impl QueueWithBackoff {
let since_the_epoch = start.duration_since(UNIX_EPOCH).unwrap().as_millis();
// We only need to check this once, as we won't be adding to the backoff queue
// as often as we pull from it.
// as often as we pull from it.
if let Some(item) = self.backoff.first_entry() {
if *item.key() < since_the_epoch {
let v = item.remove();
@ -47,7 +47,6 @@ impl QueueWithBackoff {
}
}
self.queue.pop_front()
}
@ -79,7 +78,7 @@ impl QueueWithBackoff {
while self.backoff.contains_key(&time) {
time = time + 1;
}
self.backoff.insert(time, backoff_item);
backoff_duration
}