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:
Jason Staack
2026-03-15 23:09:30 -05:00
parent f1625a85a1
commit 14ff8a54ca
3 changed files with 10 additions and 3 deletions

View File

@@ -130,8 +130,8 @@ async def _check_nats(nats_url: str) -> dict:
)
try:
await nc.drain()
except Exception:
pass
except Exception as exc:
logger.warning("Readiness check dependency failed: %s", exc)
latency_ms = round((time.monotonic() - start) * 1000)
return {"status": "up", "latency_ms": latency_ms, "error": None}
except Exception as exc:

View File

@@ -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:
"""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_id = rule["id"] if rule else None

View File

@@ -176,7 +176,7 @@ async def generate_and_store_diff(
},
)
except Exception:
pass
logger.warning("Config diff generation failed", exc_info=True)
# 11. Parse structured changes (best-effort)
try: