diff --git a/libs/utils/src/leaky_bucket.rs b/libs/utils/src/leaky_bucket.rs index 418024c9dc..509190a449 100644 --- a/libs/utils/src/leaky_bucket.rs +++ b/libs/utils/src/leaky_bucket.rs @@ -63,7 +63,7 @@ impl LeakyBucketState { pub fn bucket_is_empty(&self, config: &LeakyBucketConfig, now: Instant) -> bool { // if self.end is after now, the bucket is not empty - config.prev_multiple_of_drain(now - config.epoch) <= self.end + self.end <= config.prev_multiple_of_drain(now - config.epoch) } /// Immediately adds tokens to the bucket, if there is space.