Skip to content

Commit

Permalink
Streamline "waiting" output between openqa-cli sub commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Mar 16, 2023
1 parent 934560a commit e281420
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/OpenQA/CLI/schedule.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sub _monitor_jobs ($self, $client, $poll_interval, $job_ids, $job_results) {
push @$job_results, $job->{result} // NONE;
next;
}
print "Job state of job ID $job_id: $job_state, waiting…\n";
print "Job state of job ID $job_id: $job_state, waiting \n";
sleep $poll_interval;
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/OpenQA/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use Mojo::Util qw(decode getopt);
use Mojo::URL;
use Mojo::File qw(path);
use Term::ANSIColor qw(colored);
use open qw(:std :encoding(UTF-8));

my $JSON = Cpanel::JSON::XS->new->utf8->canonical->allow_nonref->allow_unknown->allow_blessed->convert_blessed
->stringify_infnan->escape_slash->allow_dupkeys->pretty;
Expand Down Expand Up @@ -114,7 +115,7 @@ sub retry_tx ($self, $client, $tx, $handle_args, $retries = undef, $delay = unde
$tx = $client->start($tx);
my $res_code = $tx->res->code // 0;
return $self->handle_result($tx, $handle_args) unless $res_code =~ /50[23]/ && $retries > 0;
print "Request failed, hit error $res_code, retrying up to $retries more times after waiting ...\n";
print "Request failed, hit error $res_code, retrying up to $retries more times after waiting \n";
sleep $delay;
}
}
Expand Down

0 comments on commit e281420

Please sign in to comment.