View | Details | Raw Unified | Return to bug 29325
Collapse All | Expand All

(-)a/misc/commit_file.pl (-4 / +4 lines)
Lines 83-89 sub process_batch { Link Here
83
83
84
    print "... importing MARC records -- please wait\n";
84
    print "... importing MARC records -- please wait\n";
85
    my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) =
85
    my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) =
86
        BatchCommitRecords($import_batch_id, $framework, 100, \&print_progress_and_commit);
86
        BatchCommitRecords($import_batch_id, $framework, 100, \&print_progress);
87
    print "... finished importing MARC records\n";
87
    print "... finished importing MARC records\n";
88
88
89
    print <<_SUMMARY_;
89
    print <<_SUMMARY_;
Lines 120-133 Number of records deleted: $num_deleted Link Here
120
Number of errors:                $num_errors
120
Number of errors:                $num_errors
121
Number of records reverted:      $num_reverted
121
Number of records reverted:      $num_reverted
122
Number of records ignored:       $num_ignored
122
Number of records ignored:       $num_ignored
123
Number of items added:           $num_items_deleted
123
Number of items deleted:         $num_items_deleted
124
124
125
_SUMMARY_
125
_SUMMARY_
126
}
126
}
127
127
128
128
129
sub print_progress_and_commit {
129
sub print_progress {
130
    my ( $recs, $schema ) = @_;
130
    my ( $recs ) = @_;
131
    print "... processed $recs records\n";
131
    print "... processed $recs records\n";
132
}
132
}
133
133
(-)a/tools/manage-marc-import.pl (-5 / +1 lines)
Lines 234-240 sub commit_batch { Link Here
234
    my $job = undef;
234
    my $job = undef;
235
    my ( $num_added, $num_updated, $num_items_added,
235
    my ( $num_added, $num_updated, $num_items_added,
236
        $num_items_replaced, $num_items_errored, $num_ignored );
236
        $num_items_replaced, $num_items_errored, $num_ignored );
237
    my $schema = Koha::Database->new->schema;
238
    my $callback = sub { };
237
    my $callback = sub { };
239
    if ($runinbackground) {
238
    if ($runinbackground) {
240
        $job = put_in_background($import_batch_id);
239
        $job = put_in_background($import_batch_id);
Lines 274-288 sub revert_batch { Link Here
274
    my $schema = Koha::Database->new->schema;
273
    my $schema = Koha::Database->new->schema;
275
    $schema->txn_do(
274
    $schema->txn_do(
276
        sub {
275
        sub {
277
            my $callback = sub { };
278
            if ($runinbackground) {
276
            if ($runinbackground) {
279
                $job = put_in_background($import_batch_id);
277
                $job = put_in_background($import_batch_id);
280
                $callback = progress_callback( $job );
281
            }
278
            }
282
            (
279
            (
283
                $num_deleted,       $num_errors, $num_reverted,
280
                $num_deleted,       $num_errors, $num_reverted,
284
                $num_items_deleted, $num_ignored
281
                $num_items_deleted, $num_ignored
285
            ) = BatchRevertRecords( $import_batch_id, 50, $callback );
282
            ) = BatchRevertRecords( $import_batch_id );
286
        }
283
        }
287
    );
284
    );
288
285
289
- 

Return to bug 29325