Merge branch 'tweak/internet-ping' into 'dev'

Add a fallback for google.com

See merge request crafty-controller/crafty-4!570
This commit is contained in:
Iain Powrie 2023-04-01 13:41:39 +00:00
commit 74cbf197a7
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ TBD
TBD
### Tweaks
- Improve logging on tz failures ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/569))
- Add fallback for ping domain to provide better feedback on internet connection ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/570))
### Lang
TBD
<br><br>

View File

@ -293,6 +293,11 @@ class Helpers:
try:
requests.get("https://ntp.org", timeout=1)
return True
except Exception:
try:
logger.error("ntp.org ping failed. Falling back to google")
requests.get("https://google.com", timeout=1)
return True
except Exception:
return False