From 6fe8debebab0592dd80ca4ce5abd9a0311f0d84e Mon Sep 17 00:00:00 2001 From: computergeek125 Date: Sat, 25 Sep 2021 12:25:27 -0500 Subject: [PATCH] Set TCP timeout to a more reasonable value --- app/classes/shared/helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 0bb18fa4..6b37d6fc 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -90,6 +90,7 @@ class Helpers: try: host_public = get('https://api.ipify.org').text sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(10.0) result = sock.connect_ex((host_public ,server_port)) sock.close() if result == 0: