-
Notifications
You must be signed in to change notification settings - Fork 58
Raise error if interval is larger than bucket_span #37
Copy link
Copy link
Open
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels