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

Error when not specifying window parameter #1

Open
htran-ubed opened this issue Sep 24, 2024 · 1 comment
Open

Error when not specifying window parameter #1

htran-ubed opened this issue Sep 24, 2024 · 1 comment

Comments

@htran-ubed
Copy link

When not specifying the window parameter, the default window of 60 seconds is expected to be used.

However, it usese a timedelta type which causes a type error.

\Lib\site-packages\fastapi_redis_rate_limiter\redis_rate_limiter_middleware.py", line 53, in dispatch
key = f"{client_ip}:{int(time.time() // self.window)}"
TypeError: unsupported operand type(s) for //: 'float' and 'datetime.timedelta'

@Jkrox
Copy link

Jkrox commented Sep 29, 2024

I highly recommend to do this by yourself.

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

No branches or pull requests

2 participants