made changes to CSV import to improve memory usage
uses same mechanism as postcode import code change does
This commit is contained in:
parent
acad46a9b5
commit
fdbe86a464
2 changed files with 4 additions and 4 deletions
|
@ -13,9 +13,9 @@ has '+csv_required_columns' => (
|
||||||
sub import_csv {
|
sub import_csv {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
my $rows = $self->csv_data;
|
$self->check_headers;
|
||||||
|
|
||||||
foreach my $row ( @{$rows} ) {
|
while ( my $row = $self->get_csv_line ) {
|
||||||
$self->_row_to_result($row);
|
$self->_row_to_result($row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,10 @@ has '+csv_required_columns' => (
|
||||||
sub import_csv {
|
sub import_csv {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
my $rows = $self->csv_data;
|
$self->check_headers;
|
||||||
my $lcc_org = $self->target_entity;
|
my $lcc_org = $self->target_entity;
|
||||||
|
|
||||||
foreach my $row (@{$rows}) {
|
while ( my $row = $self->get_csv_line ) {
|
||||||
$self->_row_to_result($row, $lcc_org);
|
$self->_row_to_result($row, $lcc_org);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue