diff --git a/Cargo.toml b/Cargo.toml index 142a9b8..5b05c54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "garcon" -version = "0.2.2" +version = "0.2.3" authors = ["Hans Larsen "] edition = "2018" description = "A collection of trait and classes to make your thread or async function wait." diff --git a/src/throttle.rs b/src/throttle.rs index 10af9e1..c6fa5df 100644 --- a/src/throttle.rs +++ b/src/throttle.rs @@ -132,7 +132,7 @@ impl ExponentialBackoffWaiter { let current = next.load(Ordering::Relaxed); // Find the next throttle. - let next = u64::max( + let next = u64::min( (current as f64 * self.multiplier) as u64, self.cap_as_micros, );