mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Added timeout to http calls, switched get to head
This commit is contained in:
parent
6e776d6383
commit
a26159f510
@ -17,7 +17,7 @@ class HTTPHandler(BaseHandler):
|
||||
url = "https://" + url
|
||||
db_port = self.helper.get_setting("https_port")
|
||||
try:
|
||||
resp = requests.get(url + ":" + str(port))
|
||||
resp = requests.head(url + ":" + str(port), timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
except Exception:
|
||||
port = db_port
|
||||
@ -35,7 +35,7 @@ class HTTPHandlerPage(BaseHandler):
|
||||
url = "https://" + url
|
||||
db_port = self.helper.get_setting("https_port")
|
||||
try:
|
||||
resp = requests.get(url + ":" + str(port))
|
||||
resp = requests.head(url + ":" + str(port), timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
except Exception:
|
||||
port = db_port
|
||||
|
@ -25,7 +25,7 @@ class HTTPHandlerPage(BaseHandler):
|
||||
backup_url = url + str(self.helper.get_setting("https_port"))
|
||||
|
||||
try:
|
||||
resp = requests.get(primary_url)
|
||||
resp = requests.head(primary_url, timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
url = primary_url
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user