From a2bb5e55dc64f4cf161d6bbb1639a2132ba55cf7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 7 Dec 2020 11:33:03 +0000 Subject: [PATCH] Bug 26312: (follow-up) Reset buffers even if commit fails --- misc/search_tools/rebuild_elasticsearch.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index b41c1b6b3f..39da28519a 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -306,9 +306,6 @@ sub _do_reindex { try{ $response = $indexer->update_index( \@id_buffer, \@commit_buffer ); _handle_response($response); - $commit_count = $commit; - @id_buffer = (); - @commit_buffer = (); _log( 1, "Commit complete\n" ); } catch { if( ref $_ eq 'Koha::Exceptions::Elasticsearch::BadResponse'){ @@ -316,6 +313,9 @@ sub _do_reindex { _log(2,$_->{details}); } } + $commit_count = $commit; + @id_buffer = (); + @commit_buffer = (); } } -- 2.11.0