gateRecheckDelay method
How long to wait before re-checking a gate that was CLOSED (consent not settled yet, or ads disabled) — as opposed to a load that FAILED.
This is a different question from nextDelay: a closed gate is not an error, it is a "not yet", and the common case (consent resolving a second or two after the first frame) wants a prompt re-check. Re-using cooldown here — 5 minutes by default — is what left first-frame banner and native slots blank for the first five minutes of every new install.
Backs off exponentially from RetryConfig.baseDelay and caps at
RetryConfig.maxDelay (never at the far longer cooldown), so a
permanently closed gate (the user bought Remove-Ads, or declined consent)
settles into a cheap once-a-minute check rather than spinning. The
controllers reset attempt only on a successful load, so it keeps
growing while the gate stays shut — hours of re-checks still get
RetryConfig.maxDelay, never a zero delay.
Never shorter than one second, whatever the config says (ADR-076).
nextDelay reads baseDelay and maxDelay in whole milliseconds, so
either one under 1 ms makes every delay 0 ms, and validation does not
stop that: AdFlowConfig.validate rejects a zero baseDelay, not a
sub-millisecond one, and a policy handed to a controller directly is
never validated. A failure retry may run that fast (it stops at
maxAttempts); this re-check may not, because it runs for as long as
the gate stays shut, and on a zero-delay timer it is a busy loop.
Implementation
Duration gateRecheckDelay(int attempt) {
final delay = nextDelay(attempt);
return delay < _minGateRecheckDelay ? _minGateRecheckDelay : delay;
}