Skip to content

Commit 6b93527

Browse files
committed
Add retrying logic from #964 to see if helps "sign in failed" test errors
1 parent 2e45a14 commit 6b93527

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

plotly/api/v2/utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44
from requests.compat import json as _json
55
from requests.exceptions import RequestException
6-
6+
from retrying import retry
77
from plotly import config, exceptions, version, utils
88
from plotly.api.utils import basic_auth
99

@@ -111,6 +111,8 @@ def get_headers():
111111
return headers
112112

113113

114+
@retry(wait_random_min=100, wait_random_max=1000, wait_exponential_max=10000,
115+
stop_max_delay=30000)
114116
def request(method, url, **kwargs):
115117
"""
116118
Central place to make any api v2 api request.

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ six==1.8.0
1313

1414
## timezone definitions ##
1515
pytz==2014.9
16+
17+
## retrying requests ##
18+
retrying==1.3.3

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ deps=
5757
requests==2.12.4
5858
six==1.10.0
5959
pytz==2016.10
60+
retrying==1.3.3
6061
optional: numpy==1.11.3
6162
optional: ipython[all]==5.1.0
6263
optional: jupyter==1.0.0

0 commit comments

Comments
 (0)