From 27304413e57fdbd34a1a910724430c9295013513 Mon Sep 17 00:00:00 2001 From: michaelbabyn Date: Fri, 14 Dec 2018 11:31:50 -0500 Subject: [PATCH 1/2] retry on 429 throttled status --- plotly/api/v2/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/api/v2/utils.py b/plotly/api/v2/utils.py index de3817071f4..09b0c115c31 100644 --- a/plotly/api/v2/utils.py +++ b/plotly/api/v2/utils.py @@ -114,7 +114,7 @@ def get_headers(): def should_retry(exception): if isinstance(exception, exceptions.PlotlyRequestError): if (isinstance(exception.status_code, int) and - 500 <= exception.status_code < 600): + (500 <= exception.status_code < 600 or exception.status_code == 429)): # Retry on 5XX errors. return True elif 'Uh oh, an error occurred' in exception.message: From a09db46f79addca8b9f99483a855a4c1161f3b4f Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Sat, 15 Dec 2018 06:42:30 -0500 Subject: [PATCH 2/2] Added comment describing main source of 429 errors --- plotly/api/v2/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/api/v2/utils.py b/plotly/api/v2/utils.py index 09b0c115c31..13d4aa86fc2 100644 --- a/plotly/api/v2/utils.py +++ b/plotly/api/v2/utils.py @@ -115,7 +115,7 @@ def should_retry(exception): if isinstance(exception, exceptions.PlotlyRequestError): if (isinstance(exception.status_code, int) and (500 <= exception.status_code < 600 or exception.status_code == 429)): - # Retry on 5XX errors. + # Retry on 5XX and 429 (image export throttling) errors. return True elif 'Uh oh, an error occurred' in exception.message: return True