fastapi-limiter icon indicating copy to clipboard operation
fastapi-limiter copied to clipboard

fix: when unset time limit

Open mic1on opened this issue 11 months ago • 0 comments

The RateLimiter class was designed to allow time constraints to be null and default to 0. It can be assumed that if the user does not pass any time constraints, there are no limits.

However, when 0 is passed into the Redis script: redis.call("SET", key, 1, "px", "0")

It triggers an exception:

redis.exceptions.ResponseError: invalid expire time in 'set' command script

Hence, this PR is proposed.

mic1on avatar Mar 19 '24 15:03 mic1on