Merge branch 'dev' into tweak/internet-ping

This commit is contained in:
Zedifus 2023-04-01 14:32:37 +01:00
commit 1be451d5eb
3 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@ TBD
### Bug fixes
TBD
### Tweaks
TBD
- Improve logging on tz failures ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/569))
### Lang
TBD
<br><br>

View File

@ -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))

View File

@ -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))