We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3600aad commit 9c9a50aCopy full SHA for 9c9a50a
1 file changed
aggregation_mode/proof_aggregator/src/backend/retry.rs
@@ -40,6 +40,7 @@ where
40
{
41
let mut delay = Duration::from_millis(min_delay_ms);
42
43
+ // Defensive: ensure that factor is above 1.0 so backoff never shrinks or becomes invalid.
44
let factor = (factor as f64).max(1.0);
45
46
let mut attempt: usize = 0;
@@ -66,7 +67,6 @@ where
66
67
/// TODO: Replace with the one in aggregation_mode/db/src/orchestrator.rs, or use a common method.
68
fn next_backoff_delay(current_delay: Duration, max_delay_seconds: u64, factor: f64) -> Duration {
69
let max: Duration = Duration::from_secs(max_delay_seconds);
- // Defensive: factor should be >= 1.0 for backoff, we clamp it to avoid shrinking/NaN.
70
71
let scaled_secs = current_delay.as_secs_f64() * factor;
72
let scaled_secs = if scaled_secs.is_finite() {
0 commit comments