meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rate limiter fails when hitting rate cap

vickorian opened this issue · comments

Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ
INFO: Unexpected service rate limit, backing off for 27 seconds (from headers).
Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ
INFO: Unexpected service rate limit, backing off for 27 seconds (from headers).
Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ
INFO: Unexpected service rate limit, backing off for 26 seconds (from headers).
Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ
INFO: Unexpected service rate limit, backing off for 26 seconds (from headers).
Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ
INFO: Unexpected service rate limit, backing off for 26 seconds (from headers).
Making call: https://na1.api.riotgames.com/lol/summoner/v4/summoners/UDH-9gQ5U6LqxtrbB6jkFpVXFlgj-hyPAAXdry5dVt2caToQ

then throws attribute error

with no traceback

HTTPError: Rate limit exceeded

with a final

RuntimeError: Encountered an HTTP error code 429 with message "Rate limit exceeded" which should have already been handled. Report this to the Cassiopeia team.

For some reason it's not waiting. The rate limiter usually works, i've seen it called multiple times and it hasn't failed before.

Are you using multiprocessing or multithreading or anything?

nope. This was through a jupyter notebook. Single threaded with a built in time gate of 1.5 seconds on the main function to limit requests to be approximately right at rate limit. This points to the internal loop on the rate limiter sending requests repeatedly. Maybe a broken timestamp?

Let me know if you find a way to reliably reproduce this behavior.

I'm going to close this. Feel free to reopen it with a comment if you are still seeing an issue.