Harden retention under one-click start: UME raw caps and collection TTL.

Keep inline schedulers as the start_netx.ps1 default while bounding UME raw_json and pruning old NE collection dirs on startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-02 18:16:30 +08:00
parent e0503df8a5
commit 96be90bd1a
11 changed files with 167 additions and 14 deletions

View file

@ -125,11 +125,20 @@ def run_api_startup() -> None:
backfill_port_traffic_series(db)
except Exception:
_log.exception("startup: port_traffic series backfill failed")
try:
from .ne_collection_paths import prune_old_collection_dirs
pruned = prune_old_collection_dirs()
if pruned:
_log.info("startup: pruned %s old ne_collection job dir(s)", pruned)
except Exception:
_log.exception("startup: ne_collection prune failed")
except Exception:
_log.exception("startup: ne collection / config_sync recovery failed")
finally:
db.close()
# One-click start (scripts/start_netx.ps1) keeps collectors inline with the API.
if bool(getattr(settings, "run_inline_schedulers", True)):
try:
start_device_schedulers()