-
Notifications
You must be signed in to change notification settings - Fork 88
The server's rate limiting does not trigger the proper exception. #49
Comments
Thanks for the report @Viech. We will get this fixed in |
Is this the reason that I got this? it seems that after getting ~1100 match, I got an By the way, how much is the rate limit? (Or I'd better just figure it out myself)
|
@xunlao I have not seen such a With respect to the wait time: I built an adpative rate limiter that increases it after a failed attampt multiplicatively by 20% up to a maximum of 10s and reduces it additive by 0.1s after every successful request. The resulting average wait time after a request is 6.2 seconds, currently, though this may include periods of downtime where every request was a failure. You could do the same or try wait times between 4 and 7 seconds and see which one gives you the greatest efficiency. |
@Viech Thanks for the suggestion.. I think I should just encode a logic for this. Currently I think my code (should) works well, which looks like: sleep_time = 10
while True:
try:
result = api.get_match_history_by_seq_num(start_at_match_seq_num = last_seq, matches_requested = 100)['matches']
# then export data to some json or somewhere; or keep in memory and collecting then export, but more complex code
except:
time.sleep(sleep_time) I would run this overnight.. See what happens. |
Using
get_latest_match_seq_num
, instead of adota2api.src.exceptions.APITimeoutError
, a JSON decoding exception is raised whenever the server denies one of your requests due to rate limiting.The text was updated successfully, but these errors were encountered: