|
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 |
|