diff --git a/oio/common/green.py b/oio/common/green.py index 85d6431731..a336983421 100644 --- a/oio/common/green.py +++ b/oio/common/green.py @@ -77,7 +77,7 @@ def ratelimit(run_time, max_rate, increment=1, rate_buffer=5): time_per_request = clock_accuracy * (float(increment) / max_rate) if now - run_time > rate_buffer * clock_accuracy: run_time = now - elif run_time - now > time_per_request: + elif run_time - now > 0: sleep((run_time - now) / clock_accuracy) return run_time + time_per_request