Commit 1a75e7b0 by Tom Christie

Merge pull request #1440 from un33k/master

handle zero and negative available_requests
parents 6e92e415 818b4bf8
...@@ -136,6 +136,8 @@ class SimpleRateThrottle(BaseThrottle): ...@@ -136,6 +136,8 @@ class SimpleRateThrottle(BaseThrottle):
remaining_duration = self.duration remaining_duration = self.duration
available_requests = self.num_requests - len(self.history) + 1 available_requests = self.num_requests - len(self.history) + 1
if available_requests <= 0:
return None
return remaining_duration / float(available_requests) return remaining_duration / float(available_requests)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment