Wrong Rate limits
See original GitHub issueHello, I try to found the best way to handle rate limits but I have some strange behaviors
const handleError = (err) => {
const {
shortTermUsage,
shortTermLimit,
} = strava.rateLimiting
console.lg(shortTermUsage, shortTermLimit)
throw new Error(err.message)
}
const payload = await strava.athlete.listActivities(args).catch(errors.StatusCodeError, handleError)
The error is:
429 - {"message":"Rate Limit Exceeded","errors":[{"resource":"Application","field":"rate limit","code":"exceeded"}]}
But shortTermUsage
is 574 while shortTermLimit is 600
So my script stop. The next time I start my script and I go to handleError
, shortTermUsage
and shortTermLimit
are equal to 0
like not initialized.
Did I miss something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
What is rate limiting? | Rate limiting and bots - Cloudflare
Rate limiting blocks users, bots, or applications that are over-using or abusing a web property. Rate limiting can stop certain kinds of bot...
Read more >Rate Limit Exceeded errors | Plaid Docs
Guide to understanding and troubleshooting errors returned when the request is valid but has exceeded established rate limits.
Read more >What to do when you are being rate limited
Rate limiting is a way of controlling the amount of requests handled by the site's API (Application Program Interface) — these communications are...
Read more >How to handle rate limits & errors - Klaviyo Developers
All endpoints are rate limited. Check the response codes for a 429 error, which indicates you have hit a rate limit, and retry...
Read more >Twitter 'rate limit' messages are due to an error, not your bad ...
We've seen those “rate limit exceeded” messages too, and contacted Twitter to find out what's going on. A Twitter spokesperson tells Engadget ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sounds right. PR welcome.
On Mon, Feb 3, 2020, 4:22 AM Cédric Delpoux notifications@github.com wrote:
I just did