riot-api-league icon indicating copy to clipboard operation
riot-api-league copied to clipboard

Setting Manual Rate Limit

Open Cypherous opened this issue 3 years ago • 1 comments

Hiya, firstly thank you for making this library its going to help me a lot :)

So i had a question/request with regards to the rate limiting, is it possible to set a manual rate limit? sadly i'm a novice so i can't find where the check is happening myself to edit it so if i'm missing a really obvious line somewhere i apologise >.<

The reason for this is wanting to set the limit of the library to say 80% of my max so that there is still some overhead left for users to be able to still make calls where required on a website for adding new summoners to my database with the library mostly running in the background to help update data that i store

Cypherous avatar Sep 07 '22 22:09 Cypherous

Hello! Thank you for using this library ☺️

Currently, there is no simple way to define such behaviour using the library configuration. However, you can subclass and extend the main LeagueAPI class and override RateLimitControl manager setup in the loadCache method with your own manager instance, which shall respect such constraints.

dolejska-daniel avatar Sep 08 '22 07:09 dolejska-daniel