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

Raise error if interval is larger than bucket_span #37

Open
phillipp opened this issue Sep 28, 2020 · 0 comments
Open

Raise error if interval is larger than bucket_span #37

phillipp opened this issue Sep 28, 2020 · 0 comments

Comments

@phillipp
Copy link
Contributor

I recently found that we had a lot of places where bucket_span did not span the whole interval we checked when using count or exceeded?, like when checking a rate limit for the last 24 hours without modifying bucket_span in the initualizer.

The failure is silent and I could imagine that a lot of tests would not catch this, if the adds are not wrapped in timecop etc.

I'd suggest that when the count method receives a options[:interval] larger than options[:bucket_span] an error is raised, so the problem is uncovered.

Does that make any sense?

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

1 participant