From 296910be0bcb8091f0e9f06a3ab7f5a4d365659b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 21 Mar 2025 12:07:22 -0300 Subject: [PATCH] Bug 36365: (follow-up) Indexing should be done async and in chunks Signed-off-by: Tomas Cohen Arazi Signed-off-by: Thomas Klausner --- misc/maintenance/compare_es_to_db.pl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/misc/maintenance/compare_es_to_db.pl b/misc/maintenance/compare_es_to_db.pl index 8cadbf3912..b5de6d0db3 100755 --- a/misc/maintenance/compare_es_to_db.pl +++ b/misc/maintenance/compare_es_to_db.pl @@ -33,7 +33,6 @@ use Modern::Perl; use Array::Utils qw( array_minus ); use Getopt::Long qw( GetOptions ); -use Try::Tiny qw( catch try ); use C4::Context; @@ -160,15 +159,10 @@ foreach my $index ( ( 'biblios', 'authorities' ) ) { if (@koha_problems) { print "=================\n"; - print "Fixing missing records in the index ($index):\n\n"; - - foreach my $id (@koha_problems) { - try { - $indexer->update_index( [$id] ); - } catch { - print STDERR "ERROR: record #$id failed: $_\n\n"; - }; - } + print "Scheduling indexing of missing records ($index):\n\n"; + + # index_records() takes care of splitting into chunks. + $indexer->index_records( \@koha_problems, 'specialUpdate', $server ); } if (@es_problems) { -- 2.39.5