Add 5 second timeout for http request
This commit is contained in:
parent
8fb8cc42c6
commit
c55155d0e8
|
@ -31,7 +31,7 @@ for filename in os.listdir():
|
||||||
RETURN_VALUE = 1
|
RETURN_VALUE = 1
|
||||||
print(filename + ": " + link + " is not https")
|
print(filename + ": " + link + " is not https")
|
||||||
else:
|
else:
|
||||||
res = requests.get(link)
|
res = requests.get(link, timeout=5)
|
||||||
if res.status_code != 200:
|
if res.status_code != 200:
|
||||||
RETURN_VALUE = 1
|
RETURN_VALUE = 1
|
||||||
print(filename + ": " + link + " returns " + str(res.status_code))
|
print(filename + ": " + link + " returns " + str(res.status_code))
|
||||||
|
|
Loading…
Reference in New Issue