mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-04-26 01:32:11 +00:00
On busy meshes (325K+ transmissions, 50 observers), every ingest poll triggers a full distance index rebuild (1M+ hop records) because new observations frequently pick longer paths via pickBestObservation. With 1-second poll intervals, the rebuild never finishes before the next one starts, pegging CPU at 100% and starving the HTTP server. Fix: mark the distance index dirty on path changes but only rebuild at most every 30 seconds. The initial Load() rebuild still runs synchronously, and distLast is set afterward to prevent an immediate re-rebuild on the first ingest cycle. Discovered on Cascadia Mesh instance (cascadiamesh.org) where the server was completely unresponsive due to continuous distance index rebuilds consuming all CPU. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>