From e5fe5c909e575bc69f8dc40e590a2f6b077edc6e Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 10 Aug 2022 16:15:19 -0400 Subject: [PATCH] try to make highest job ID win when removing duplicates --- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 4c9f4b66..c9f53311 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -159,10 +159,11 @@ sub jq_getsome { -and => [ %job_properties, -or => [{ - job => { '!=' => $job->id }, + job => { '<' => $job->id }, },{ job => $job->id, -exists => $jobs->search({ + job => { '>' => $job->id }, status => { -like => 'queued-%' }, started => \[q/> (now() - ?::interval)/, setting('jobs_stale_after')], %job_properties,