mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix check_address_status
This commit is contained in:
parent
c82d411c05
commit
ed6b0eb946
@ -328,11 +328,11 @@ class Helpers:
|
||||
@staticmethod
|
||||
def check_address_status(address):
|
||||
try:
|
||||
requests.get(address, timeout=1)
|
||||
time.sleep(1)
|
||||
requests.get(address, timeout=1)
|
||||
return True
|
||||
except:
|
||||
response = requests.get(address, timeout=2)
|
||||
return (
|
||||
response.status_code // 100 == 2
|
||||
) # Check if the status code starts with 2
|
||||
except requests.RequestException:
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
Reference in New Issue
Block a user