Skip to content

Commit 9c9a50a

Browse files
Move and improve a bit the defensive comment
1 parent 3600aad commit 9c9a50a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • aggregation_mode/proof_aggregator/src/backend

aggregation_mode/proof_aggregator/src/backend/retry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ where
4040
{
4141
let mut delay = Duration::from_millis(min_delay_ms);
4242

43+
// Defensive: ensure that factor is above 1.0 so backoff never shrinks or becomes invalid.
4344
let factor = (factor as f64).max(1.0);
4445

4546
let mut attempt: usize = 0;
@@ -66,7 +67,6 @@ where
6667
/// TODO: Replace with the one in aggregation_mode/db/src/orchestrator.rs, or use a common method.
6768
fn next_backoff_delay(current_delay: Duration, max_delay_seconds: u64, factor: f64) -> Duration {
6869
let max: Duration = Duration::from_secs(max_delay_seconds);
69-
// Defensive: factor should be >= 1.0 for backoff, we clamp it to avoid shrinking/NaN.
7070

7171
let scaled_secs = current_delay.as_secs_f64() * factor;
7272
let scaled_secs = if scaled_secs.is_finite() {

0 commit comments

Comments
 (0)