Closed Colorfulstan closed 7 years ago
rate-limiting headers are now available (app and method) and should be used for rate-limiter
All API responses now include the X-App-Rate-Limit and X-Method-Rate-Limit headers that show the API key rate limit and method endpoint rate limits that are applied to calls for your API key.
Our ask is, now that these exist, PLEASE use the headers. Do not hard code values. Use the headers and write your logic to respect what they are telling you. Note that for multi-threaded apps, it will require using a shared atomic counter across the threads to properly implement your pacing/rate limiting logic, but it is definitely doable. You should also still use the Retry-After header and implement back off logic. All the headers exist for a reason. : )
Working on a rate-limiter rework to be published independently and used as dependency for this project. Will add a link to repository here as soon as Ill set it up.
Monkey patched the static-data limit for now until finishing the rate-limiter rework https://github.com/Colorfulstan/LeagueJS/compare/v1.3.0...v1.3.1 (propably needs some more time then until aug.7 - 80% done, starting integration tests).
Will be solved when ratelimiter change got published (currently testing) https://github.com/Colorfulstan/LeagueJS/releases/tag/v1.5.0-beta.1
published in 1.5.0
Besides the App-wide rate-limiting Riot now added method-limiting too which in the current (reworked) implementation is not considered.
Info from 2017/Jul/10
My initial thought for solving this would be to add this information to the Config file and create a new Ratelimiter for the respective endpoints, scheduling the call to ApiRequest.executing, where then in turn the actual request will be scheduled to fit the App-rate limit.
Reference to general rate limiting infos