Revert "device skips should not be used on priority jobs"

We still must respect per backend skipping

This reverts commit 7b9e7f4deb.
This commit is contained in:
Oliver Gorwits
2017-06-12 10:42:34 +01:00
parent 7b9e7f4deb
commit 647b78534b

View File

@@ -38,8 +38,15 @@ sub _getsome {
return () if ((!defined $num_slots) or ($num_slots < 1)); return () if ((!defined $num_slots) or ($num_slots < 1));
return () if ((!defined $where) or (ref {} ne ref $where)); return () if ((!defined $where) or (ref {} ne ref $where));
my $rs = schema('netdisco')->resultset('Admin')->search({ $fqdn ||= (hostfqdn || 'localhost');
status => 'queued', %$where, 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,
}, { order_by => 'random()', rows => $num_slots }); }, { order_by => 'random()', rows => $num_slots });
my @returned = (); my @returned = ();
@@ -50,15 +57,9 @@ sub _getsome {
} }
sub jq_getsome { sub jq_getsome {
my $jobs = schema('netdisco')->resultset('Admin'); return _getsome(shift,
$fqdn ||= (hostfqdn || 'localhost'); { action => { -in => setting('job_prio')->{'normal'} } }
);
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 { sub jq_getsomep {