()
| 750 | let consecutiveFlushFailures = 0 |
| 751 | |
| 752 | const getFlushDelayMs = () => { |
| 753 | if (consecutiveFlushFailures === 0) return FLUSH_INTERVAL_MS |
| 754 | const backoff = Math.min( |
| 755 | FLUSH_INTERVAL_MS * 2 ** Math.min(consecutiveFlushFailures, 6), |
| 756 | FLUSH_MAX_RETRY_INTERVAL_MS |
| 757 | ) |
| 758 | return backoff + randomInt(0, FLUSH_INTERVAL_MS) |
| 759 | } |
| 760 | |
| 761 | const scheduleFlush = (delayMs = FLUSH_INTERVAL_MS) => { |
| 762 | if (flushTimer) return |
no test coverage detected