Git Product home page Git Product logo

Comments (2)

dalabarge avatar dalabarge commented on May 27, 2024

Thanks @ItsReddi for using the package and for leaving your issue. I'm looking into reproducing the issue and will respond with a solution if we identify a bug.

I think at first glance, X-RateLimit-Limit is supposed to remain at the upper limit of 600 while X-RateLimit-Remaining is to tell you how many hits you have left in the bucket before hitting the 600 limit. So in your case 599 then 594. The retry-after should be formatted X-RateLimit-Retry-After and should only show up when you are rate limited. The X-RateLimit-Reset I supposed to be the unix timestamp of when your timeout is reset.

Another issue might be your actual configuration and our explanation of multi-bucket usage. We've got some improved documentation we are working on posting which should help clarify issues like this. Give me a bit of time and we'll get this all sorted out for you.

If you need something more urgently reach out to [email protected].

from ratelimiter.

ItsReddi avatar ItsReddi commented on May 27, 2024

Thanks for your reply i could set up an reproduction repository / with a vscode .devcontainer if that would help.
More than this i am unsure if we both understood the same issue.
I see the following issue, with the above configuration:

Actual result not hitting the limit on /api/v1/tasks:

...
X-RateLimit-Limit: 600    <--- thats from the global bucket
X-RateLimit-Remaining: 599 <--- thats from the global bucket
...

Expected result not hitting the limit on /api/v1/tasks:

...
X-RateLimit-Limit: 5 <--- should be from the route bucket
X-RateLimit-Remaining: 4 <--- should be from the route bucket
...

Actual result hitting the limit on /api/v1/tasks: (while beeing throttled, after 5 requests)
Here comes a mixed response from both buckets.

...
X-RateLimit-Limit: 600 <--- thats from the global bucket
X-RateLimit-Remaining: 594 <--- thats from the global bucket
retry-after: 30 <--- thats from the route bucket
x-ratelimit-reset: 1695987256 <--- unsure, from where it is, did not calulate
...

Epected result hitting the limit on /api/v1/tasks: (while beeing throttled, after 5 requests)

...
X-RateLimit-Limit: 5 <--- thats from the route bucket
X-RateLimit-Remaining: 0 <--- thats from the route bucket
retry-after: 30 <--- thats from the route bucket
x-ratelimit-reset: 1695987256 <--- thats from the route bucket
...

Furthermore:
I would expect another result if i would be limited due to the global bucket.
For example if i would overflow the global bucket with api/v2 requests, api/v1 requests should return:

...
X-RateLimit-Limit: 600 <--- thats from the global bucket
X-RateLimit-Remaining: 0 <--- thats from the global bucket
retry-after: 300<--- thats from the global bucket
x-ratelimit-reset: 1695987256 <--- thats from the global bucket
...

from ratelimiter.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.