Skip to content

Commit

Permalink
might as well handle all the 502 and 504 too
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Jan 15, 2016
1 parent 1dd5150 commit 2db5a71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twarc.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ def new_f(*args, **kwargs):
seconds = 10
logging.warn("rate limit exceeded: sleeping %s secs", seconds)
time.sleep(seconds)
elif resp.status_code in (500, 503):
elif resp.status_code >= 500:
errors += 1
if errors > 20:
if errors > 30:
logging.warn("too many errors from Twitter, giving up")
resp.raise_for_status()
seconds = 60 * errors
Expand Down

0 comments on commit 2db5a71

Please sign in to comment.