Only return distinct Port MAC's and skip '00:00:00:00:00:00' addresses in get_port_macs database query, to reduce the number of rows returned from the database to those we will be able to use
This commit is contained in:
		| @@ -41,8 +41,9 @@ sub get_port_macs { | ||||
|  | ||||
|     my $dp_macs | ||||
|         = schema('netdisco')->resultset('DevicePort') | ||||
|         ->search( { mac => { '!=' => undef } }, | ||||
|         { select => [ 'mac', 'ip' ] } ); | ||||
|         ->search( { mac => { '!=', [ undef, '00:00:00:00:00:00' ] } }, | ||||
|         { select => [ 'mac', 'ip' ], | ||||
|           group_by => [ 'mac', 'ip' ] } ); | ||||
|     my $dp_cursor = $dp_macs->cursor; | ||||
|     while ( my @vals = $dp_cursor->next ) { | ||||
|         $port_macs->{ $vals[0] } = $vals[1]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user