[OPEN-ILS-DEV] Problems with open-ils.ingest.full.biblio.record_list
Dan Scott
denials at gmail.com
Wed Apr 8 00:21:22 EDT 2009
In both trunk and rel_1_4, the implementation of
open-ils.ingest.full.biblio.record_list seems to be broken; it
immediately returns an undefined value because we're passing $rec
(scalar value of @rec) to the bre search method. Changing this to a
reference to the list fixes the problem.
We were also returning a value consisting of the sum of the record IDs
that were processed, rather than a count of the IDs.
I've fixed these issues in r12816 using a minimalist approach, but
it's not clear to me why the current implementation is as complex as
it is. ingest.full.biblio.record_list seems to be a copy of
ingest.full.biblio.record, with a bit of extra code to iterate over
the incoming list and to return a count of the records that were
successfully processed. Replacing it with an implementation that just
iterates over ingest.full.biblio.record for each element of the list
(below) works just as well, and (at least to my eyes) is easier to
read.
sub rw_biblio_ingest_record_list {
my $self = shift;
my $client = shift;
my @rec = ref($_[0]) ? @{ $_[0] } : @_ ;
OpenILS::Application::Ingest->post_init();
my $count = 0;
foreach my $record (@rec) {
if (($self->method_lookup("open-ils.ingest.full.biblio.record")->run($record))[0])
{
$count++;
}
}
return $count;
}
--
Dan Scott
Laurentian University
More information about the Open-ils-dev
mailing list