From 9164f17ea6b8c8d14fb6e98ce45b27ae58072579 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Renvoize Signed-off-by: Joonas Kylmälä --- 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.11.0