Browse Source

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Jonathan Druart 3 years ago
parent
commit
98503334cc
  1. 25
      admin/background_jobs.pl
  2. 11
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt

25
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(

11
koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt

@ -23,8 +23,6 @@
[% FOR m IN messages %]
<div class="dialog message">
[% SWITCH m.code %]
[% CASE 'cannot_retrieve_jobs' %]
<div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error | html %])</div>
[% CASE 'cannot_view_job' %]
<div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
[% CASE %]
@ -143,15 +141,6 @@
<h2>Background jobs</h2>
<div class="dialog message">
<i class="fa fa-info"></i>
[% 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 %]
</div>
[% IF jobs.count %]
<table id="table_background_jobs">
<thead>

Loading…
Cancel
Save