Skip to content

Commit 4646b13

Browse files
committed
retry on 429 throttled status (plotly#1307)
* retry on 429 throttled status * Added comment describing main source of 429 errors
1 parent 8301bb1 commit 4646b13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: plotly/api/v2/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def get_headers():
114114
def should_retry(exception):
115115
if isinstance(exception, exceptions.PlotlyRequestError):
116116
if (isinstance(exception.status_code, int) and
117-
500 <= exception.status_code < 600):
118-
# Retry on 5XX errors.
117+
(500 <= exception.status_code < 600 or exception.status_code == 429)):
118+
# Retry on 5XX and 429 (image export throttling) errors.
119119
return True
120120
elif 'Uh oh, an error occurred' in exception.message:
121121
return True

0 commit comments

Comments
 (0)