mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-18 17:15:13 +01:00
Merge branch 'dev' into tweak/dashboard-storage
This commit is contained in:
commit
f4b8685c8e
@ -5,7 +5,8 @@ TBD
|
||||
### Bug fixes
|
||||
TBD
|
||||
### Tweaks
|
||||
TBD
|
||||
- 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>
|
||||
|
@ -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):
|
||||
|
@ -134,9 +134,10 @@ class ServerInstance:
|
||||
self.last_backup_failed = False
|
||||
try:
|
||||
self.tz = get_localzone()
|
||||
except ZoneInfoNotFoundError:
|
||||
except ZoneInfoNotFoundError as e:
|
||||
logger.error(
|
||||
"Could not capture time zone from system. Falling back to Europe/London"
|
||||
f" error: {e}"
|
||||
)
|
||||
self.tz = ZoneInfo("Europe/London")
|
||||
self.server_scheduler = BackgroundScheduler(timezone=str(self.tz))
|
||||
|
@ -47,9 +47,10 @@ class TasksManager:
|
||||
self.tornado: Webserver = Webserver(helper, controller, self)
|
||||
try:
|
||||
self.tz = get_localzone()
|
||||
except ZoneInfoNotFoundError:
|
||||
except ZoneInfoNotFoundError as e:
|
||||
logger.error(
|
||||
"Could not capture time zone from system. Falling back to Europe/London"
|
||||
f" error: {e}"
|
||||
)
|
||||
self.tz = "Europe/London"
|
||||
self.scheduler = BackgroundScheduler(timezone=str(self.tz))
|
||||
|
Loading…
x
Reference in New Issue
Block a user