fix: add logging to silent error handlers, check maintenance windows for online events
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,8 +130,8 @@ async def _check_nats(nats_url: str) -> dict:
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await nc.drain()
|
await nc.drain()
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
logger.warning("Readiness check dependency failed: %s", exc)
|
||||||
latency_ms = round((time.monotonic() - start) * 1000)
|
latency_ms = round((time.monotonic() - start) * 1000)
|
||||||
return {"status": "up", "latency_ms": latency_ms, "error": None}
|
return {"status": "up", "latency_ms": latency_ms, "error": None}
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|||||||
@@ -696,6 +696,13 @@ async def evaluate_offline(device_id: str, tenant_id: str) -> None:
|
|||||||
|
|
||||||
async def evaluate_online(device_id: str, tenant_id: str) -> None:
|
async def evaluate_online(device_id: str, tenant_id: str) -> None:
|
||||||
"""Resolve offline alert when device comes back online."""
|
"""Resolve offline alert when device comes back online."""
|
||||||
|
if await _is_device_in_maintenance(tenant_id, device_id):
|
||||||
|
logger.debug(
|
||||||
|
"Online event suppressed by maintenance window for device %s",
|
||||||
|
device_id,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
rule = await _get_offline_rule(tenant_id)
|
rule = await _get_offline_rule(tenant_id)
|
||||||
rule_id = rule["id"] if rule else None
|
rule_id = rule["id"] if rule else None
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ async def generate_and_store_diff(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
logger.warning("Config diff generation failed", exc_info=True)
|
||||||
|
|
||||||
# 11. Parse structured changes (best-effort)
|
# 11. Parse structured changes (best-effort)
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user