Ref #2220
This commit is contained in:
parent
b7b8834105
commit
78ce90aa8d
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue