my $queue_name;
my $text_mode;
-my $debug;
+my $debug = 0;
my $debug_children;
sub usage() {
GetOptions(
"q|queue=s" => \$queue_name,
"text!" => \$text_mode,
- "debug!" => \$debug,
+ "debug+" => \$debug,
"debug-children!" => \$debug_children,
"p|parallel=i" => \$BEX::Config::max_parallel_jobs,
"help" => \&usage,
my $pri = $state_to_pri{$host_state{$s->{'Host'}}};
my ($best, $besti);
- my $bestpri = -1;
+ my $bestpri = 99;
for my $i (0..$nrows-1) {
my $r = $by_row[$i];
if (!defined $r) {
last;
}
my $rpri = $state_to_pri{$host_state{$r->{'Host'}}};
+ print STDERR "I: ... considering ", $r->{'Host'}, " (pri $rpri, lu ", $r->{'LastUpdate'}, ")\n" if $debug > 1;
next if $rpri > $pri;
if ($rpri < $bestpri ||
$rpri == $bestpri && $r->{'LastUpdate'} < $best->{'LastUpdate'}) {
- # Trick: $best must be defined, as otherwise $bestpri == -1
+ # Trick: $best must be defined, as otherwise $bestpri == 99
$best = $r;
$besti = $i;
$bestpri = $rpri;