Closed wuzechen closed 6 years ago
Hey we haven't done much testing for multithreaded apps, although I'm a bit surprised it didn't work. So yeah this is probably a bug. If you've got more code that I can use to reproduce this issue that'd be great (so that I can just copy-paste for testing exactly your problem).
It's the holiday so we might not get to it right away, but hopefully we'll have time to look into it in a week or so, and if the bug isn't too bad hopefully we can fix it quickly.
I'm sorry to disturb you during the holiday. I wrote the code base on the match_collection.py example, and do sth more about collecting KDA and some other features. And mutil thread part code is below
class collecterThread (threading.Thread):
def __init__(self, threadID, initial_summoner_name, region, patch):
threading.Thread.__init__(self)
self.threadID = threadID
self.initial_summoner_name = initial_summoner_name
self.region = region
self.patch = patch
def run(self):
print("crate thread {0}".format(self.region))
while True:
data_collecter.collect_matches(self.initial_summoner_name, self.region, self.patch)
if __name__ == "__main__":
#cass.set_riot_api_key("") # This overrides the value set in your configuration/settings.
cass.apply_settings("setting.json")
#cass.set_default_region("JP")
# data_collecter.collect_matches("Hide on Bush", "KR")
threadJP = collecterThread(1, "XXX", "JP", "7.22")
threadKR = collecterThread(2, "Hide on Bush", "KR", "7.22")
threadNA = collecterThread(3, "Søren Bjerg", "NA", "7.22")
threadEU = collecterThread(4, "FNC Rekkles", "EUW", "7.22")
threadJP.start()
threadKR.start()
threadNA.start()
threadEU.start()
No worries, a couple of emails is hardly a bother :)
Thanks for the code too. Will check it out soon!
Hey sorry for the long delay. This took a bit to figure out. It should be fixed now.
Hi, I am developing a match log collector, and it works well when I download data from the single region once time. I am trying to download all 4 regions data (NA EUW KR JP) mutilThreadly at the same time. The code is written as below. collector thread will create a single thread work well collector.
Then I found the rate limiter doesn't work properly. I print out the call log. Here is it.
After these calls, collecting is stopped, or limited.
"Note that rate limits are enforced per region. For example, with the above rate limit, you could make 20 requests every 1 seconds to both NA and EUW endpoints simultaneously."
Riot said that rate limits are enforced per region, and my rate is 100/2min. It means I can download almost 50 matches(1 match costs 2 calls, match, and timelines) at the same time, but absolutely it doesn't work like I expected.
Is it a bug?