-
Notifications
You must be signed in to change notification settings - Fork 78
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
Change rate limit after the app has started #64
Comments
You should be able to pass a callable that returns a limit string, something like def dynamic_limit():
# do anything you want here
return "1/minute"
@limiter.limit(dynamic_limit)
async def homepage(request: Request):
return PlainTextResponse("test") Let me know if this works for your use case. |
Thank you Laurent for explanation. I suggest we add this example in the test case (tests/test_fastapi_extension.py). It will be helpful for others as well. |
Sounds good! Feel free to send a PR for this, or to add an example in the docs. |
Thanks, I will raise a PR. Could you please give me access to push a branch. |
I don't have access to the repo settings from mobile, but you can fork the repo and open a PR from there. |
Hi Laurent, I raised a PR : #66 as per above discussion. I have a doubt, as seen in my PR I am using exempt in this format : |
Hi @laurentS, could you please review above mentioned PR. |
Is it possible to change the rate limit of app or particular route after the app has started?
The text was updated successfully, but these errors were encountered: