zebra-report: exponential retransmit backoff (stop hammering on lost ACK)
This commit is contained in:
parent
abde9079c8
commit
1183e17ba3
1 changed files with 2 additions and 1 deletions
|
|
@ -1010,7 +1010,8 @@ function renderOutbox() {
|
|||
function scheduleRetransmit(crc) {
|
||||
const entry = msgPending.get(crc);
|
||||
if (!entry) return;
|
||||
const wait = estimateTxMs(entry.frame.length) + estimateTxMs(15) + 4000; /* data + ack + margin */
|
||||
const base = estimateTxMs(entry.frame.length) + estimateTxMs(15) + 4000; /* data + ack + margin */
|
||||
const wait = base * Math.pow(1.8, entry.tries - 1); /* exponential backoff — don't hammer */
|
||||
entry.timer = setTimeout(async () => {
|
||||
const e = msgPending.get(crc);
|
||||
if (!e) return; /* already ACKed */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue