Skip to content

Commit

Permalink
only log rate limit errors when requests fail
Browse files Browse the repository at this point in the history
the rate limit will be 0 for the last successful request with status 200
  • Loading branch information
minrk committed Feb 22, 2017
1 parent c8b2c64 commit a830816
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nbviewer/providers/github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _log_rate_limit(self, future):

remaining = int(remaining_s)
limit = int(limit_s)
if remaining == 0:
if remaining == 0 and status >= 400:
text = response_text(r)
try:
message = json.loads(text)['message']
Expand Down

0 comments on commit a830816

Please sign in to comment.