diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a15f0d..e8feec95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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

diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index cf108bcd..9efb8b0a 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -294,7 +294,12 @@ class Helpers: requests.get("https://ntp.org", timeout=1) return True except Exception: - return False + try: + logger.error("ntp.org ping failed. Falling back to google") + requests.get("https://google.com", timeout=1) + return True + except Exception: + return False @staticmethod def check_port(server_port):