From 1eee121bed6749a49da3ec95bbe76335ecf57540 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 Jun 2022 09:31:51 +0000 Subject: [PATCH] Bug 29325: (QA follow-up) Tidy up tools/manage-marc-import.pl: sub commit_batch does no longer need $schema tools/manage-marc-import.pl: sub revert_batch: calling BatchRevertRecords which has no interval and callback misc/commit_file.pl: sub print_progress_and_commit does no longer commit, renamed misc/commit_file.pl: sub print_progress does no longer have a schema parameter misc/commit_file.pl: sub revert_batch reported deleted items as added Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- misc/commit_file.pl | 8 ++++---- tools/manage-marc-import.pl | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/misc/commit_file.pl b/misc/commit_file.pl index da504d2a3a..d18dda68c4 100755 --- a/misc/commit_file.pl +++ b/misc/commit_file.pl @@ -83,7 +83,7 @@ sub process_batch { print "... importing MARC records -- please wait\n"; my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) = - BatchCommitRecords($import_batch_id, $framework, 100, \&print_progress_and_commit); + BatchCommitRecords($import_batch_id, $framework, 100, \&print_progress); print "... finished importing MARC records\n"; print <<_SUMMARY_; @@ -120,14 +120,14 @@ Number of records deleted: $num_deleted Number of errors: $num_errors Number of records reverted: $num_reverted Number of records ignored: $num_ignored -Number of items added: $num_items_deleted +Number of items deleted: $num_items_deleted _SUMMARY_ } -sub print_progress_and_commit { - my ( $recs, $schema ) = @_; +sub print_progress { + my ( $recs ) = @_; print "... processed $recs records\n"; } diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index f74db44358..9ee6917be4 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -234,7 +234,6 @@ sub commit_batch { my $job = undef; my ( $num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored ); - my $schema = Koha::Database->new->schema; my $callback = sub { }; if ($runinbackground) { $job = put_in_background($import_batch_id); @@ -274,15 +273,13 @@ sub revert_batch { my $schema = Koha::Database->new->schema; $schema->txn_do( sub { - my $callback = sub { }; if ($runinbackground) { $job = put_in_background($import_batch_id); - $callback = progress_callback( $job ); } ( $num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored - ) = BatchRevertRecords( $import_batch_id, 50, $callback ); + ) = BatchRevertRecords( $import_batch_id ); } ); -- 2.39.5