-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rate limit hits when using searches / conversations / file based input #575
Comments
Oh yeah, good point, that does need an extra sleep. |
Double checking, the client should add the sleep even to the final page for the archive search (apparently I thought ahead?): https://github.com/DocNow/twarc/blob/main/twarc/client2.py#L245 I can take a belt and suspenders approach, but that 901 seconds is probably coming from this decorator - have they missed a warning?: https://github.com/DocNow/twarc/blob/main/twarc/decorators2.py#L42 |
Yeah the search method and client2.py is fine, that works - the error appears when we're reading a text file and looping over users - because it's a fresh call to the api for each user, the client can potentially make 2 calls within 1 second - eg:
here after a full 15 min rate limit sleep, it makes 1 call processing one line, gets no results, then <1 second later processes the next line and hits the limit again, so an extra sleep(1) in the for loop that processes the input file should avoid this without slowing things down significantly |
Oh, empty pages of results, of course! |
No wait, I don't think it's empty results at all - there's always at least one item for this iterator. If those results were empty, they should also be seeing the log on line 243 as well explicitly about an empty page. I do think the error is in the library though. |
Okay yeah, reviewing the original thread again - I think this is because the various command line At some point, it's probably worth taking another look at a decorator for that particular case/checking the headers that Twitter returns for that particular rate limit case. |
Fixed in #578 |
When a loop like
twarc/twarc/command2.py
Line 1448 in 51b31cd
Example log where this is happening: https://twittercommunity.com/t/inconsistent-rate-limit-academic-research-full-archive-search/162928/14?u=igorbrigadir
The text was updated successfully, but these errors were encountered: