Skip to content

Commit fe66f9c

Browse files
committed
Add a 5s timeout to the download request.
1 parent f049351 commit fe66f9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plotly/graph_reference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from plotly import exceptions, files, utils
1616

1717
GRAPH_REFERENCE_PATH = '/v2/plot-schema'
18+
GRAPH_REFERENCE_DOWNLOAD_TIMEOUT = 5 # seconds
1819

1920

2021
def get_graph_reference():
@@ -43,7 +44,8 @@ def get_graph_reference():
4344
GRAPH_REFERENCE_PATH, sha1)
4445

4546
try:
46-
response = requests.get(graph_reference_url)
47+
response = requests.get(graph_reference_url,
48+
timeout=GRAPH_REFERENCE_DOWNLOAD_TIMEOUT)
4749
response.raise_for_status()
4850
except requests.exceptions.RequestException:
4951
if not graph_reference:

0 commit comments

Comments
 (0)