mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-10-28 13:01:15 +00:00
add timeout to Ping
This commit is contained in:
1 parent
61f9af86aa
commit
2b5e9c02bb
1 file changed
+2
-2
@@ -183,7 +183,7 @@ class Ping:
|
||||
@staticmethod
|
||||
def __call__() -> bool:
|
||||
try:
|
||||
requests.get("https://google.com")
|
||||
requests.get("https://google.com", timeout=10)
|
||||
return True
|
||||
except requests.exceptions.ConnectionError:
|
||||
except (requests.exceptions.ConnectionError, requests.Timeout):
|
||||
return False
|
||||
Reference in new issue
Block a user