From 5452eaa539e986746f1c5ec0281add9d23d78935 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 16 Apr 2019 17:27:03 +0100 Subject: [PATCH] do not show ignored dupe jobs in job queue --- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 7cd3c9ff..0b04a3d8 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -270,7 +270,9 @@ sub jq_complete { } sub jq_log { - return schema('netdisco')->resultset('Admin')->search({}, { + return schema('netdisco')->resultset('Admin')->search({ + 'me.log' => { '-not_like' => 'duplicate of %' }, + }, { prefetch => 'target', order_by => { -desc => [qw/entered device action/] }, rows => (setting('jobs_qdepth') || 50), @@ -281,6 +283,7 @@ sub jq_userlog { my $user = shift; return schema('netdisco')->resultset('Admin')->search({ username => $user, + log => { '-not_like' => 'duplicate of %' }, finished => { '>' => \"(now() - interval '5 seconds')" }, })->with_times->all; }