made changes to CSV import to improve memory usage

uses same mechanism as postcode import code change does
This commit is contained in:
Finn 2019-09-11 14:19:12 +01:00
parent acad46a9b5
commit fdbe86a464
2 changed files with 4 additions and 4 deletions

View file

@ -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);
} }
} }

View file

@ -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);
} }
} }