swicthed back to network mod and added helatcheck for diagnostic to restart

This commit is contained in:
2026-03-13 08:26:02 +01:00
parent 72fdebe50d
commit 4893d5e2ba
3 changed files with 43 additions and 9 deletions
+15
View File
@@ -556,6 +556,8 @@ class ARIABridge:
async def connect_to_core(self) -> None:
"""Persistente WebSocket-Verbindung zu aria-core (OpenClaw Gateway)."""
retry_delay = 2
max_conn_failures = 6
conn_fail_count = 0
while self.running:
try:
@@ -570,6 +572,7 @@ class ARIABridge:
self.ws_core = ws
retry_delay = 2
conn_fail_count = 0
logger.info("[core] Verbunden und authentifiziert")
async for message in ws:
@@ -577,13 +580,25 @@ class ARIABridge:
except websockets.ConnectionClosed:
logger.warning("[core] Verbindung verloren")
conn_fail_count += 1
except ConnectionRefusedError:
logger.warning("[core] Nicht erreichbar (%s)", self.ws_url)
conn_fail_count += 1
except Exception:
logger.exception("[core] WebSocket-Fehler")
conn_fail_count += 1
finally:
self.ws_core = None
# Nach N aufeinanderfolgenden Fehlern: Exit damit Docker neustartet
# (bekommt neuen Network-Namespace wenn aria-core restarted wurde)
if conn_fail_count >= max_conn_failures:
logger.error(
"[core] %dx nicht erreichbar — Exit fuer Docker-Restart",
conn_fail_count,
)
sys.exit(1)
if self.running:
logger.info("[core] Reconnect in %ds...", retry_delay)
await asyncio.sleep(retry_delay)