mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
Refresh Fabric KPIs live while an LLDP collect job is running.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2cbdc896f6
commit
ba038a3af6
2 changed files with 16 additions and 1 deletions
|
|
@ -111,6 +111,12 @@ def _run_discover_job(job_id: str, body: FabricDiscoverRequest) -> None:
|
|||
job.edges_updated = updated
|
||||
job.updated_at = _utcnow()
|
||||
db.commit()
|
||||
# Keep Fabric KPI cache roughly in sync during long runs (dashboard polls job).
|
||||
if int(job.done or 0) % 50 == 0:
|
||||
try:
|
||||
refresh_fabric_stats(db)
|
||||
except Exception: # noqa: BLE001
|
||||
db.rollback()
|
||||
|
||||
# Absent on a successfully scanned endpoint → missing; purge after N cycles.
|
||||
if scanned_ok:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue