mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
add timeout to Ping
This commit is contained in:
@@ -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