Skip to content

Commit db039bb

Browse files
authored
Merge pull request #9 from tidewave-ai/sd-fix-backoff
fix backoff calculation
2 parents b8bc2b6 + a5084f3 commit db039bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ impl AppState {
134134
}
135135

136136
pub fn get_backoff_duration(&self) -> Duration {
137-
let seconds = std::cmp::min(2u64.pow(self.connect_tries.saturating_sub(1)), 8);
137+
let clamped_tries = std::cmp::min(self.connect_tries, 3);
138+
let seconds = 2u64.pow(clamped_tries);
138139
Duration::from_secs(seconds)
139140
}
140141

0 commit comments

Comments
 (0)