From 2246c5d77f0bc531be36804133b62c6e8cd8b8dd 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 --- 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 8cadbf3912f..b5de6d0db3f 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.49.0