Skip to content

Commit b4c9df8

Browse files
authored
WEB: Add timeout for ci (#56440)
1 parent 9b51ab2 commit b4c9df8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

web/pandas_web.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ def maintainers_add_info(context):
175175
context["maintainers"]["active"] + context["maintainers"]["inactive"]
176176
):
177177
resp = requests.get(
178-
f"https://api.github.com/users/{user}", headers=GITHUB_API_HEADERS
178+
f"https://api.github.com/users/{user}",
179+
headers=GITHUB_API_HEADERS,
180+
timeout=5,
179181
)
180182
if resp.status_code == 403:
181183
sys.stderr.write(
@@ -184,7 +186,7 @@ def maintainers_add_info(context):
184186
# if we exceed github api quota, we use the github info
185187
# of maintainers saved with the website
186188
resp_bkp = requests.get(
187-
context["main"]["production_url"] + "maintainers.json"
189+
context["main"]["production_url"] + "maintainers.json", timeout=5
188190
)
189191
resp_bkp.raise_for_status()
190192
maintainers_info = resp_bkp.json()
@@ -214,10 +216,13 @@ def home_add_releases(context):
214216
resp = requests.get(
215217
f"https://api.github.com/repos/{github_repo_url}/releases",
216218
headers=GITHUB_API_HEADERS,
219+
timeout=5,
217220
)
218221
if resp.status_code == 403:
219222
sys.stderr.write("WARN: GitHub API quota exceeded when fetching releases\n")
220-
resp_bkp = requests.get(context["main"]["production_url"] + "releases.json")
223+
resp_bkp = requests.get(
224+
context["main"]["production_url"] + "releases.json", timeout=5
225+
)
221226
resp_bkp.raise_for_status()
222227
releases = resp_bkp.json()
223228
else:
@@ -302,10 +307,13 @@ def roadmap_pdeps(context):
302307
"https://api.github.com/search/issues?"
303308
f"q=is:pr is:open label:PDEP repo:{github_repo_url}",
304309
headers=GITHUB_API_HEADERS,
310+
timeout=5,
305311
)
306312
if resp.status_code == 403:
307313
sys.stderr.write("WARN: GitHub API quota exceeded when fetching pdeps\n")
308-
resp_bkp = requests.get(context["main"]["production_url"] + "pdeps.json")
314+
resp_bkp = requests.get(
315+
context["main"]["production_url"] + "pdeps.json", timeout=5
316+
)
309317
resp_bkp.raise_for_status()
310318
pdeps = resp_bkp.json()
311319
else:

0 commit comments

Comments
 (0)