tomchristie/django-rest-framework — pull request #1440 by un33k (2014-02-25 21:29:47+00:00)
Title: handle zero and negative available_requests

This change is a fix for issue https://github.com/tomchristie/django-rest-framework/issues/1438.

This is when the total number of outstanding requests is less than the total allowed requests due to the change of the throttle rate in the settings file.

Higher the discrepancy, shorter the wait time. This is so the system can catch up.

Also, avoids negative wait time and divide by zero exceptions.

All unit tests pass.