fix: watcher manager now displays "heard from" status, instead of unit status. Refreshes ever 60 mins, if havent heard from in >60 mins display missing.
This commit is contained in:
@@ -216,20 +216,9 @@ async def series3_heartbeat(request: Request, db: Session = Depends(get_db)):
|
||||
|
||||
results.append({"unit": uid, "status": status})
|
||||
|
||||
# Determine overall worst status for the watcher agent row
|
||||
statuses = [r["status"] for r in results]
|
||||
if "Missing" in statuses:
|
||||
agent_status = "missing"
|
||||
elif "Pending" in statuses:
|
||||
agent_status = "pending"
|
||||
elif statuses:
|
||||
agent_status = "ok"
|
||||
else:
|
||||
agent_status = "unknown"
|
||||
|
||||
if source:
|
||||
_upsert_watcher_agent(db, source, "series3_watcher", version,
|
||||
client_ip, log_tail_str, agent_status)
|
||||
client_ip, log_tail_str, "ok")
|
||||
|
||||
db.commit()
|
||||
|
||||
@@ -340,20 +329,9 @@ async def series4_heartbeat(request: Request, db: Session = Depends(get_db)):
|
||||
|
||||
results.append({"unit": uid, "status": status})
|
||||
|
||||
# Determine overall worst status for the watcher agent row
|
||||
statuses = [r["status"] for r in results]
|
||||
if any(s.lower() == "stale" for s in statuses):
|
||||
agent_status = "missing"
|
||||
elif any(s.lower() == "late" for s in statuses):
|
||||
agent_status = "pending"
|
||||
elif statuses:
|
||||
agent_status = "ok"
|
||||
else:
|
||||
agent_status = "unknown"
|
||||
|
||||
if source:
|
||||
_upsert_watcher_agent(db, source, "series4_watcher", version,
|
||||
client_ip, log_tail_str, agent_status)
|
||||
client_ip, log_tail_str, "ok")
|
||||
|
||||
db.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user