diff --git a/Netdisco/Changes b/Netdisco/Changes index 5c4a71e2..4b80f149 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -3,6 +3,7 @@ [ENHANCEMENTS] * Ports with active nodes are set to be "up" immediately (closes #9) + * Avoid returning to the DB for every MAC on a neighbor port [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm index 29eed68e..1d03a261 100644 --- a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm +++ b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm @@ -64,7 +64,8 @@ sub do_macsuck { store_wireless_client_info($device, $snmp, $now); # cache the device ports to save hitting the database for many single rows - my $device_ports = {map {($_->port => $_)} $device->ports->all}; + my $device_ports = {map {($_->port => $_)} + $device->ports(undef, {prefetch => 'neighbor_alias'})->all}; my $port_macs = get_port_macs($device); # get forwarding table data via basic snmp connection