use Scalar::Util qw(weaken);
use System::Introspector::Gatherer;
use System::Introspector::Logger qw( :log :dlog );
-use System::Introspector::Report;
+use System::Introspector::Gatherer::Report;
has config => (is => 'ro', required => 1);
has root => (is => 'ro', required => 1);
-#undef is unlimited concurrency
sub user { $_[0]->config->user }
sub sudo_user { $_[0]->config->sudo_user }
log_info { my $c = scalar(@hosts); "This gather run is for $c hosts" };
while(scalar(@hosts) > 0) {
- my @scan = splice(@hosts, 0, $concurrent_max);
- my @waiting;
+ my (@scan, @waiting);
+
+ if (defined($concurrent_max)) {
+ @scan = splice(@hosts, 0, $concurrent_max);
+ } else {
+ @scan = @hosts;
+ }
Dlog_trace { my $c = scalar(@scan); "Scanning $c hosts in this gather loop" } @scan;