Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: when unset time limit #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mic1on
Copy link

@mic1on mic1on commented Mar 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant