mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix unhandled exception with port check function
This commit is contained in:
parent
3e84df601f
commit
d93038a70d
@ -87,6 +87,7 @@ class Helpers:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_port(server_port):
|
def check_port(server_port):
|
||||||
|
try:
|
||||||
host_public = get('https://api.ipify.org').text
|
host_public = get('https://api.ipify.org').text
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
result = sock.connect_ex((host_public ,server_port))
|
result = sock.connect_ex((host_public ,server_port))
|
||||||
@ -95,6 +96,8 @@ class Helpers:
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
except Exception as err:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def check_for_old_logs(self, db_helper):
|
def check_for_old_logs(self, db_helper):
|
||||||
|
Loading…
Reference in New Issue
Block a user