X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=eg_staged_bib_overlay;h=4df0cdeaba9c32ec28dbb4c286c47f5615833bf3;hp=a517a6a760a0b7a74a5b86e4c4b10ba61bbcb415;hb=06e695c596e784a9e2634b25612b4bd23ac047af;hpb=3423a92f6d9a9f0eeb31682f121377a0216aa240 diff --git a/eg_staged_bib_overlay b/eg_staged_bib_overlay index a517a6a..4df0cde 100755 --- a/eg_staged_bib_overlay +++ b/eg_staged_bib_overlay @@ -33,7 +33,7 @@ my $dbpw; my $dbhost; my $batch; my $cutoff; -my $wait = 1; +my $wait = 0; my $output; my $link_skipped; @@ -285,14 +285,13 @@ sub handle_stage_bibs { my $marc = MARC::Record->new_from_usmarc($_); my $bibid = $marc->subfield('901', 'c'); if ($bibid !~ /^\d+$/) { - print STDERR "Record $i is suspect; skipping\n"; - next; + die('Subfield 901$c is not numeric or missing.'); } my $xml = OpenILS::Application::AppUtils->entityize($marc->as_xml_record()); $ins->execute($xml, $bibid); }; if ($@) { - print STDERR "Record $i is bad; skipping\n"; + warn("Record $i is bad: $@; skipping."); next; } } @@ -405,7 +404,7 @@ sub handle_load_bibs { ) }); $dbh->commit; - sleep $wait; + sleep $wait if ($wait); } } @@ -473,7 +472,7 @@ sub handle_stage_auths { $ins->execute($xml, $authid, $lccn, $cancelled_lccn, $xml); }; if ($@) { - print STDERR "Record $i is bad; skipping\n"; + warn("Record $i is bad: $@; skipping."); next; } }