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

Rate limiting caching

Open gunaso opened this issue 4 years ago • 7 comments

Does rate limiting caching only prevents you to do more requests while you are not able to? Or waits until you have permission to make more requests and keeps going with the script?

gunaso avatar Mar 05 '20 18:03 gunaso

Hello, rate limiting as currently implemented raises exception when unable to send request. But I can see usage when this could be inappropriate.

dolejska-daniel avatar Mar 05 '20 20:03 dolejska-daniel

Are you thinking on implementing s system where instead of raising an exception, it stays in standby until the key is able to send requests again?

gunaso avatar Mar 05 '20 20:03 gunaso

It could be done..

dolejska-daniel avatar Mar 05 '20 21:03 dolejska-daniel

I will need this feature, if you didn't start anything I guess I will work on it :)

elreco avatar Jul 16 '20 21:07 elreco

We should be able to set variables when initializing the API with :

x request(s) per x seconds exemple : LeagueAPI::SET_KEY_LIMIT_1 => 20_1 for 20 request(s) per 1 second

AND

x request(s) per x minutes exemple : LeagueAPI::SET_KEY_LIMIT_1 => 20_1 for 100 request(s) per 2 minutes

depending on the given api key limitations.

elreco avatar Jul 16 '20 21:07 elreco

@elreco why set limits during initialization? Key limits for each resource can be loaded after their first request.

dolejska-daniel avatar Jul 17 '20 06:07 dolejska-daniel

@dolejska-daniel you are right

elreco avatar Jul 17 '20 07:07 elreco