We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99a26ba commit b73358fCopy full SHA for b73358f
src/lib.rs
@@ -490,9 +490,8 @@ impl BackgroundTask {
490
})
491
}
492
fn backoff_time(&self) -> (bool, Duration) {
493
- let backoff_count: u64 = self.backoff_count.into();
494
- let backoff_time = if backoff_count >= 1 {
495
- Duration::from_millis(500 * (1 << (backoff_count - 1)))
+ let backoff_time = if self.backoff_count >= 1 {
+ Duration::from_millis(500u64.checked_shl(self.backoff_count - 1).unwrap_or(u64::MAX))
496
} else {
497
Duration::from_millis(0)
498
};
0 commit comments