From 74f227c40b7d2d08d989f6d7f100a24e9754da7b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 2 Jun 2022 08:04:20 +0200 Subject: [PATCH] Bug 30462: Delete the update_elastic_index jobs when done One entry per reindexation will generate a lot of rows in this table and the UI will become unusable. We should either hide them by default or simply remove them from the DB. This patch implements the second option. Test plan: Edit a bibliographic record If you are fast enough you should see a "new" jobs in the background_jobs DB table When done/finished, the rows will be deleted from the DB --- Koha/BackgroundJob/UpdateElasticIndex.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/BackgroundJob/UpdateElasticIndex.pm b/Koha/BackgroundJob/UpdateElasticIndex.pm index c3a77a43c16..e47c08c69bf 100644 --- a/Koha/BackgroundJob/UpdateElasticIndex.pm +++ b/Koha/BackgroundJob/UpdateElasticIndex.pm @@ -80,8 +80,8 @@ sub process { } } else { $self->step; - # FIXME This is not correct if some record_ids have been skipped - $report->{total_success} = scalar @record_ids; + $self->delete; + return; } my $data = $self->decoded_data; -- 2.25.1