change to the data directly automatically with mig env use
[migration-tools.git] / eg_staged_bib_overlay
index 7e57e9a..a2d776c 100755 (executable)
@@ -33,7 +33,7 @@ my $dbpw;
 my $dbhost;
 my $batch;
 my $cutoff;
-my $wait = 0;
+my $wait = 1;
 my $output;
 my $link_skipped;
 
@@ -285,7 +285,7 @@ sub handle_stage_bibs {
             my $marc = MARC::Record->new_from_usmarc($_);
             my $bibid = $marc->subfield('901', 'c');
             if ($bibid !~ /^\d+$/) {
-                 die('Subfield 901$c is not numeric or missing.');
+                die('Subfield 901$c is not numeric or missing.');
             }
             my $xml = OpenILS::Application::AppUtils->entityize($marc->as_xml_record());
             $ins->execute($xml, $bibid);
@@ -387,7 +387,7 @@ sub handle_load_bibs {
                 FROM $schema.$batch
                 WHERE to_import
                 AND NOT imported
-                ORDER BY id
+                ORDER BY bib_id DESC
                 LIMIT 1
             )
         });
@@ -404,7 +404,7 @@ sub handle_load_bibs {
             )
         });
         $dbh->commit;
-        sleep $wait if ($wait);
+        sleep $wait;
     }
 }
 
@@ -594,6 +594,7 @@ sub handle_load_new_auths {
             )
         });
         $dbh->commit;
+        sleep $wait;
     }
 }