mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
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:
commit
74cbf197a7
@ -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>
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user