Skip to content

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

@GunaShekar02

Description

@GunaShekar02

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions