From 237b1c9cc2a684141e9f0a464edabd1bd549df7f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2020 11:56:09 +0200 Subject: [PATCH] Bug 22417: Remove list of pending jobs This was not accurate as it was only retrieving jobs for batch_biblio_record_modification We will need to improve that later if needed --- admin/background_jobs.pl | 25 +------------------ .../prog/en/modules/admin/background_jobs.tt | 11 -------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl index ef8422d39b..1d36b97e64 100755 --- a/admin/background_jobs.pl +++ b/admin/background_jobs.pl @@ -79,30 +79,7 @@ if ( $op eq 'cancel' ) { if ( $op eq 'list' ) { my $jobs = Koha::BackgroundJobs->search({}, { order_by => { -desc => 'enqueued_on' }}); - my @pending_jobs; - try { - my $conn = Koha::BackgroundJob->connect; - my $job_type = 'batch_biblio_record_modification'; - $conn->subscribe({ destination => $job_type, ack => 'client' }); - my @frames; - while (my $frame = $conn->receive_frame({timeout => 1})) { - last unless $frame; - my $body = $frame->body; - my $args = decode_json($body); - push @pending_jobs, $args->{job_id}; - push @frames, $frame; - } - $conn->nack( { frame => $_ } ) for @frames; - $conn->disconnect; - } catch { - push @messages, { - type => 'error', - code => 'cannot_retrieve_jobs', - error => $_, - }; - }; - - $template->param( jobs => $jobs, pending_jobs => \@pending_jobs, ); + $template->param( jobs => $jobs ); } $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt index 40cf28c9cf..8731486026 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt @@ -23,8 +23,6 @@ [% FOR m IN messages %]
[% SWITCH m.code %] - [% CASE 'cannot_retrieve_jobs' %] -
Cannot retrieve pending jobs ([% m.error | html %])
[% CASE 'cannot_view_job' %]
Insufficient permission to see this job.
[% CASE %] @@ -143,15 +141,6 @@

Background jobs

-
- - [% IF pending_jobs.size > 0 %] - There is [% pending_jobs.size | html %] pending jobs on the server: [% pending_jobs.join(', ') | html %]. - [% ELSE %] - There is no pending jobs on the server. - [% END %] -
- [% IF jobs.count %] -- 2.20.1