device skips should not be used on priority jobs
This commit is contained in:
@@ -38,15 +38,8 @@ sub _getsome {
|
||||
return () if ((!defined $num_slots) or ($num_slots < 1));
|
||||
return () if ((!defined $where) or (ref {} ne ref $where));
|
||||
|
||||
$fqdn ||= (hostfqdn || 'localhost');
|
||||
my $jobs = schema('netdisco')->resultset('Admin');
|
||||
|
||||
my $rs = $jobs->search({
|
||||
status => 'queued',
|
||||
device => { '-not_in' =>
|
||||
$jobs->skipped($fqdn, setting('workers')->{'max_deferrals'})
|
||||
->columns('device')->as_query },
|
||||
%$where,
|
||||
my $rs = schema('netdisco')->resultset('Admin')->search({
|
||||
status => 'queued', %$where,
|
||||
}, { order_by => 'random()', rows => $num_slots });
|
||||
|
||||
my @returned = ();
|
||||
@@ -57,9 +50,15 @@ sub _getsome {
|
||||
}
|
||||
|
||||
sub jq_getsome {
|
||||
return _getsome(shift,
|
||||
{ action => { -in => setting('job_prio')->{'normal'} } }
|
||||
);
|
||||
my $jobs = schema('netdisco')->resultset('Admin');
|
||||
$fqdn ||= (hostfqdn || 'localhost');
|
||||
|
||||
return _getsome(shift, {
|
||||
action => { -in => setting('job_prio')->{'normal'} },
|
||||
device => { -not_in =>
|
||||
$jobs->skipped($fqdn, setting('workers')->{'max_deferrals'})
|
||||
->columns('device')->as_query },
|
||||
});
|
||||
}
|
||||
|
||||
sub jq_getsomep {
|
||||
|
||||
Reference in New Issue
Block a user