mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-19 17:39:06 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6249dcc7e |
@@ -64,9 +64,20 @@ class PluginHealthTracker:
|
||||
cache_key, max_age=None, memory_ttl=0 if force_reload else None
|
||||
)
|
||||
|
||||
if cached:
|
||||
if isinstance(cached, dict) and cached:
|
||||
return cached
|
||||
|
||||
# A cache entry that is not a dict means the persisted state was written
|
||||
# by something other than _save_health_state (a key collision, a partial
|
||||
# write, a restored backup). Returning it verbatim makes every caller
|
||||
# blow up on .get(), which takes the display down in a restart loop that
|
||||
# survives reboots because the bad entry is on disk. Discard and rebuild.
|
||||
if cached is not None and not isinstance(cached, dict):
|
||||
self.logger.warning(
|
||||
f"Discarding malformed health state for {plugin_id}: expected "
|
||||
f"dict, got {type(cached).__name__}. Falling back to defaults."
|
||||
)
|
||||
|
||||
# Default state
|
||||
return {
|
||||
'consecutive_failures': 0,
|
||||
|
||||
@@ -10,8 +10,8 @@ WorkingDirectory=__PROJECT_ROOT_DIR__
|
||||
ExecStart=/usr/bin/python3 __PROJECT_ROOT_DIR__/scripts/utils/wifi_monitor_daemon.py --interval 30
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=ledmatrix-wifi-monitor
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -9,7 +9,11 @@ User=root
|
||||
WorkingDirectory=__PROJECT_ROOT_DIR__
|
||||
Environment=PYTHONDONTWRITEBYTECODE=1
|
||||
ExecStart=/usr/bin/python3 __PROJECT_ROOT_DIR__/run.py
|
||||
Restart=on-failure
|
||||
# Restart=always, not on-failure: run.py exiting 0 (a clean shutdown path taken
|
||||
# for a reason that no longer applies, e.g. a config reload) would otherwise leave
|
||||
# the service stopped and the panel dark indefinitely, with systemd considering
|
||||
# that a successful outcome and never bringing it back.
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
Reference in New Issue
Block a user