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

(-)a/Koha/BackgroundJob/MARCImportCommitBatch.pm (-4 / +4 lines)
Lines 65-78 sub process { Link Here
65
    my ( $num_added, $num_updated, $num_items_added,
65
    my ( $num_added, $num_updated, $num_items_added,
66
        $num_items_replaced, $num_items_errored, $num_ignored );
66
        $num_items_replaced, $num_items_errored, $num_ignored );
67
    try {
67
    try {
68
        my $size = Koha::Import::Records->search({ import_batch_id => $import_batch_id })->count;
69
        $self->size($size)->store;
70
        (
68
        (
71
            $num_added, $num_updated, $num_items_added,
69
            $num_added, $num_updated, $num_items_added,
72
            $num_items_replaced, $num_items_errored, $num_ignored
70
            $num_items_replaced, $num_items_errored, $num_ignored
73
          )
71
          )
74
          = BatchCommitRecords( $import_batch_id, $frameworkcode, 50,
72
          = BatchCommitRecords( $import_batch_id, $frameworkcode, 50,
75
            sub { my $job_progress = shift; $self->progress( $job_progress )->store } );
73
            sub { my $job_progress = shift; $self->progress( $job_progress )->store } );
74
        my $count = $num_added + $num_updated;
75
        $self->set({ progress => $count, size => $count })->store if $count;
76
    }
76
    }
77
    catch {
77
    catch {
78
        warn $_;
78
        warn $_;
Lines 106-113 sub enqueue { Link Here
106
    my ( $self, $args) = @_;
106
    my ( $self, $args) = @_;
107
107
108
    $self->SUPER::enqueue({
108
    $self->SUPER::enqueue({
109
        job_size => 0, # unknown for now
109
        job_size => Koha::Import::Records->search({ import_batch_id => $args->{import_batch_id} })->count,
110
        job_args => $args
110
        job_args => $args,
111
    });
111
    });
112
}
112
}
113
113
(-)a/Koha/BackgroundJob/MARCImportRevertBatch.pm (-4 / +6 lines)
Lines 23-28 use base 'Koha::BackgroundJob'; Link Here
23
use C4::ImportBatch qw(
23
use C4::ImportBatch qw(
24
    BatchRevertRecords
24
    BatchRevertRecords
25
);
25
);
26
use Koha::Import::Records;
26
27
27
=head1 NAME
28
=head1 NAME
28
29
Lines 68-75 sub process { Link Here
68
        (
69
        (
69
            $num_deleted,       $num_errors, $num_reverted,
70
            $num_deleted,       $num_errors, $num_reverted,
70
            $num_items_deleted, $num_ignored
71
            $num_items_deleted, $num_ignored
71
        ) = BatchRevertRecords( $import_batch_id, 50,
72
        ) = BatchRevertRecords( $import_batch_id ); # TODO BatchRevertRecords still needs a progress_callback
72
            sub { my $job_progress = shift; $self->progress( $job_progress )->store } );
73
        my $count = $num_deleted + $num_reverted;
74
        $self->set({ progress => $count, size => $count })->store if $count;
73
    }
75
    }
74
    catch {
76
    catch {
75
        warn $_;
77
        warn $_;
Lines 103-110 sub enqueue { Link Here
103
    my ( $self, $args) = @_;
105
    my ( $self, $args) = @_;
104
106
105
    $self->SUPER::enqueue({
107
    $self->SUPER::enqueue({
106
        job_size => 0, # unknown for now
108
        job_size => Koha::Import::Records->search({ import_batch_id => $args->{import_batch_id} })->count,
107
        job_args => $args
109
        job_args => $args,
108
    });
110
    });
109
}
111
}
110
112
(-)a/Koha/BackgroundJob/StageMARCForImport.pm (-1 / +1 lines)
Lines 125-130 sub process { Link Here
125
                $self->progress( int($job_progress) )->store;
125
                $self->progress( int($job_progress) )->store;
126
              }
126
              }
127
          );
127
          );
128
        $self->set({ progress => $num_valid, size => $num_valid })->store if $num_valid;
128
129
129
        if ($profile_id) {
130
        if ($profile_id) {
130
            my $ibatch = Koha::ImportBatches->find($batch_id);
131
            my $ibatch = Koha::ImportBatches->find($batch_id);
131
- 

Return to bug 27421