Avoid returning to the DB for every MAC on a neighbor port

This commit is contained in:
Oliver Gorwits
2013-10-19 20:54:48 +01:00
parent b9ed21ea41
commit 1f50ab1166
2 changed files with 3 additions and 1 deletions

View File

@@ -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