my $self = shift;
my $client = shift;
my $auth = shift;
- my $fingerprint = shift;
+ my $fingerprint = shift || '';
my $queue_id = shift;
+ my $purpose = shift;
+ my $filename = shift;
+ my $bib_source = shift;
my $e = new_editor(authtoken => $auth, xact => 1);
return $e->die_event unless $e->checkauth;
my $cache = new OpenSRF::Utils::Cache();
- my $data = $cache->get_cache('vandelay_import_spool_' . $fingerprint);
- my $purpose = $data->{purpose};
- my $filename = $data->{path};
- my $bib_source = $data->{bib_source};
+ if($fingerprint) {
+ my $data = $cache->get_cache('vandelay_import_spool_' . $fingerprint);
+ $purpose = $data->{purpose};
+ $filename = $data->{path};
+ $bib_source = $data->{bib_source};
+ }
unless(-r $filename) {
$logger->error("unable to read MARC file $filename");
my $r = -1;
while (try { $r = $batch->next } otherwise { $r = -1 }) {
if ($r == -1) {
- $logger->warn("Proccessing of record $count in set $fingerprint failed. Skipping this record");
+ $logger->warn("Proccessing of record $count in set $filename failed. Skipping this record");
$count++;
}
$e->commit;
unlink($filename);
- $cache->delete_cache('vandelay_import_spool_' . $fingerprint);
+ $cache->delete_cache('vandelay_import_spool_' . $fingerprint) if $fingerprint;
return undef;
}