From 0915839361cb6e9f00e05356ba49fb3e188887d1 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 Signed-off-by: Tomas Cohen Arazi --- 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 c3a77a43c1..e47c08c69b 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.34.1