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

Support milliseconds #4

Merged
merged 3 commits into from Feb 22, 2021
Merged

Conversation

rowrowrowrow
Copy link
Contributor

Thanks for the great contribution to FastApi!

I was thinking it'd be a good idea to support milliseconds so that:

  1. fractions of seconds can be used, and
  2. it's the unit expiring information is stored https://redis.io/commands/expire#expires-and-persistence

My first take is that milliseconds should be used as the default for all rate limiting but to avoid breaking changes I'd be happy to add a flag for seconds vs. milliseconds. Please let me know what you think!

@rowrowrowrow rowrowrowrow changed the title use milliseconds instead of seconds. Support milliseconds Feb 21, 2021
Copy link
Owner

@long2ice long2ice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, which is useful for who need more meticulous control. Could you update default_callback in https://github.com/long2ice/fastapi-limiter/blob/master/fastapi_limiter/__init__.py and changelog.md?

@long2ice
Copy link
Owner

Good, thanks for that!

@long2ice long2ice merged commit 3a597be into long2ice:master Feb 22, 2021
@rowrowrowrow
Copy link
Contributor Author

Thanks as well!!

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.

None yet

2 participants