vutran1710/PyrateLimiter

LimiterSession - Floats in per_second parameter cause intermittent exceptions

Closed this issue · 1 comments

code snippet for context:
LimiterSession(per_second=2.6)

It doesn't happen immediately but eventually after doing session.get(), a ConnectionError will be raised, with the content suggesting it can't convert floats to integers.

The typehinting for "per_second" suggests that it can be a float, but these exceptions suggest otherwise.

The documentation doesn't state either way what is the expected behaviour, so clarity of expectation would be appreciated.

The rate limit for the API I'm implementing against is 2 per second, with a burst of 10 that resets at a frequency that ends up with it being effectively one request every 0.35 seconds, a little under 3 per second, which is what I'm trying to achieve.

This is my first time submitting a github issue so if you need any specifics for this to be considered, please let me know :)

Err... I dont remember having anything like LimiterSession. Maybe you are using something else other than PyrateLimiter?