From 8ff474eed4b926352f56952ddf84fa7082bf9e9d 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 Signed-off-by: Martin Renvoize --- 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 e88b1e9201..9206b4c11a 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -307,9 +307,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'){ @@ -317,6 +314,9 @@ sub _do_reindex { _log(2,$_->{details}); } } + $commit_count = $commit; + @id_buffer = (); + @commit_buffer = (); } } -- 2.20.1