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 an unlimited rate limit everywhere #5667

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

Conversation

doug-threatmate
Copy link
Contributor

@doug-threatmate doug-threatmate commented Sep 26, 2024

Proposed changes

Everywhere that ratelimiter.New is used, we now support ratelimiter.NewUnlimited when the value given is zero.

In places that used to check to see that both the numerator and the denominator were 0, they now only check to see if the numerator is zero.

From a user perspective, the difference between 0 seconds, 0 milliseconds, and 0 hours is meaningless. It is clear that when they say zero, they mean zero.

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Everywhere that `ratelimiter.New` is used, we now support
`ratelimiter.NewUnlimited` when the value given is zero.

In places that used to check to see that _both_ the numerator
and the denominator were 0, they now only check to see if the
numerator is zero.

From a user perspective, the difference between 0 seconds,
0 milliseconds, and 0 hours is meaningless.  It is clear that when
they say zero, they mean zero.
@GeorginaReeder
Copy link

Thanks so much for your contribution @doug-threatmate ! :)

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.

2 participants