Skip to content

Commit

Permalink
Limit implementation for sub list_scheduled_ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
r-richardson committed Nov 9, 2022
1 parent 63ff32a commit b9ade4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/OpenQA/WebAPI/Controller/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ sub list_running_ajax {

sub list_scheduled_ajax {
my ($self) = @_;
my $limits = OpenQA::App->singleton->config->{misc_limits};
my $limit = min($limits->{generic_max_limit}, $self->param('limit') // $limits->{generic_default_limit});

my $scheduled = $self->schema->resultset('Jobs')->complex_query(
state => [OpenQA::Jobs::Constants::PRE_EXECUTION_STATES],
Expand All @@ -180,6 +182,7 @@ sub list_scheduled_ajax {
blocked_by_id priority
)
],
limit => $limit,
);

my @scheduled;
Expand Down

0 comments on commit b9ade4c

Please sign in to comment.