feat: hook topology inference into polling pipeline

DevicePollerWorker calls Topology.process_device/2 after saving
neighbor data. Topology updates incrementally every poll cycle.
This commit is contained in:
Graham McIntire 2026-02-12 13:07:29 -06:00
parent be153d364e
commit 02f1af6fe3
No known key found for this signature in database

View file

@ -328,6 +328,15 @@ defmodule Towerops.Workers.DevicePollerWorker do
"device:#{device.id}",
{:neighbors_updated, device.id}
)
# Run topology inference after neighbor data is saved
case Towerops.Topology.process_device(device, device.organization_id) do
{:ok, :changed} ->
Logger.debug("Topology updated for #{device.name}")
{:ok, :unchanged} ->
:ok
end
rescue
error ->
Logger.error("Error polling neighbors for #{device.name}: #{inspect(error)}\n#{Exception.format_stacktrace()}")