This commit is contained in:
garnier-quentin 2020-10-06 11:54:18 +02:00
parent b7b8834105
commit 78ce90aa8d
1 changed files with 5 additions and 1 deletions

View File

@ -167,6 +167,7 @@ sub request_api {
push @$results, @{$decoded->{results}};
last if (!defined($decoded->{next}));
last if if (defined($options{nonext}) && $options{nonext} == 1);
$page++;
}
@ -204,7 +205,10 @@ sub tower_list_schedules {
my $schedules = $self->request_api(endpoint => '/schedules/');
if (defined($options{add_job_status})) {
for (my $i = 0; $i < scalar(@$schedules); $i++) {
my $job = $self->request_api(force_endpoint => '/schedules/' . $schedules->[$i]->{id} . '/jobs/?order_by=-id&page_size=1');
my $job = $self->request_api(
force_endpoint => '/schedules/' . $schedules->[$i]->{id} . '/jobs/?order_by=-id&page_size=1',
nonext => 1
);
$schedules->[$i]->{last_job} = $job->[0];
}
}