From 8d6bfcf0b2cb209721b6bb8c15f28dfe0b4efa92 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 17 Dec 2017 20:14:21 +0000 Subject: [PATCH] allow custom actions to be handled by scheduler --- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 80405701..53ead077 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -87,12 +87,10 @@ sub jq_getsome { my $hiprio = $jobs->search({ %jobsearch, - -or => [{ - username => { '!=' => undef }, - action => { -in => setting('job_prio')->{'normal'} }, - },{ - action => { -in => setting('job_prio')->{'high'} }, - }], + -or => [ + { username => { '!=' => undef } }, + { action => { -in => setting('job_prio')->{'high'} } }, + ], }, { %randoms, '+select' => [\'100 as job_priority'], '+as' => ['me.job_priority'], @@ -100,7 +98,7 @@ sub jq_getsome { my $loprio = $jobs->search({ %jobsearch, - action => { -in => setting('job_prio')->{'normal'} }, + action => { -not_in => setting('job_prio')->{'high'} }, }, { %randoms, '+select' => [\'0 as job_priority'], '+as' => ['me.job_priority'],