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

Wait from final request of the interval rather than the first #91

Open
GunaShekar02 opened this issue Jun 9, 2022 · 0 comments
Open

Comments

@GunaShekar02
Copy link

Currently, the number of seconds to wait is this.curIntervalStart + this.tokenBucket.interval - now. Instead I'd like to have the limiter wait for just this.tokenBucket.interval instead.

Example:-
Consider rate limit to be 10 per minute. Assume each request takes 2 seconds to execute.

curIntervalStart = 0th second
Request 1 = 2nd second
Request 2 = 4th second
....
Request 10 = 20th second

The current system would wait and restart at the 60th second(0+60), but I'd like it to wait and restart at the 80th second(20+60).

If this can be done, I'd be happy to help implement this.

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