File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,13 @@ class TestDocsLinks(unittest.TestCase):
3030
3131 @staticmethod
3232 def check_link (_url , branch_name ):
33+ headers = {'User-Agent' : 'Mozilla/5.0' }
3334 try :
34- retry_attempts = 5
35- for attempt in range (retry_attempts ):
36- response = requests .get (_url )
37- print (f"[{ response .status_code } ] { _url } " )
38- if response .status_code == 429 :
39- wait_time = 0.1 # Exponential backoff
40- print (f"Rate-limited! Retrying in { wait_time } seconds..." )
41- time .sleep (wait_time )
42- else :
43- break
35+ response = requests .get (_url , headers = headers , timeout = 1 )
36+ print (f"[{ response .status_code } ] { _url } " )
4437
45- if response .status_code == 200 :
46- return True
38+ if response .status_code == 200 :
39+ return True
4740 except Exception as e :
4841 print (f"Error checking link '{ _url } ': { e } " )
4942
You can’t perform that action at this time.
0 commit comments