@@ -175,7 +175,9 @@ def maintainers_add_info(context):
175
175
context ["maintainers" ]["active" ] + context ["maintainers" ]["inactive" ]
176
176
):
177
177
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 ,
179
181
)
180
182
if resp .status_code == 403 :
181
183
sys .stderr .write (
@@ -184,7 +186,7 @@ def maintainers_add_info(context):
184
186
# if we exceed github api quota, we use the github info
185
187
# of maintainers saved with the website
186
188
resp_bkp = requests .get (
187
- context ["main" ]["production_url" ] + "maintainers.json"
189
+ context ["main" ]["production_url" ] + "maintainers.json" , timeout = 5
188
190
)
189
191
resp_bkp .raise_for_status ()
190
192
maintainers_info = resp_bkp .json ()
@@ -214,10 +216,13 @@ def home_add_releases(context):
214
216
resp = requests .get (
215
217
f"https://api.github.com/repos/{ github_repo_url } /releases" ,
216
218
headers = GITHUB_API_HEADERS ,
219
+ timeout = 5 ,
217
220
)
218
221
if resp .status_code == 403 :
219
222
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
+ )
221
226
resp_bkp .raise_for_status ()
222
227
releases = resp_bkp .json ()
223
228
else :
@@ -302,10 +307,13 @@ def roadmap_pdeps(context):
302
307
"https://api.github.com/search/issues?"
303
308
f"q=is:pr is:open label:PDEP repo:{ github_repo_url } " ,
304
309
headers = GITHUB_API_HEADERS ,
310
+ timeout = 5 ,
305
311
)
306
312
if resp .status_code == 403 :
307
313
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
+ )
309
317
resp_bkp .raise_for_status ()
310
318
pdeps = resp_bkp .json ()
311
319
else :
0 commit comments