@@ -, +, @@ committed 1 - Have Koha using Elasticsearch 2 - Stage and import a file of records 3 - View the job in Admin->Manage jobs 4 - Note it is not finished 5 - Check log: /var/log/koha/kohadev/es-indexer-output.log 6 - Note: [WARN] No job found for id=### 7 - Apply patch 8 - Stage and import 9 - Note no error in log --- C4/ImportBatch.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -714,15 +714,16 @@ sub BatchCommitRecords { $sth->finish(); + SetImportBatchStatus($batch_id, 'imported'); + + # Moved final commit to the end + $schema->txn_commit; + if ( @biblio_ids ) { my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); $indexer->index_records( \@biblio_ids, "specialUpdate", "biblioserver" ); } - SetImportBatchStatus($batch_id, 'imported'); - - # Moved final commit to the end - $schema->txn_commit; return ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored); } --