LP#1580676 MARC stream authority cleanup repair
authorBill Erickson <berickxx@gmail.com>
Wed, 11 May 2016 16:19:12 +0000 (12:19 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 24 May 2016 17:22:37 +0000 (13:22 -0400)
Delete the successfully imported authority record from the vandelay
authority queue instead of the bib record that happens to have the same
ID as the imported authority record.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/support-scripts/marc_stream_importer.pl

index f51e0ff..29d5e85 100755 (executable)
@@ -371,10 +371,12 @@ sub import_queued_records {
     $pcrud->request('open-ils.pcrud.transaction.begin', $authtoken)->recv;
     my $err;
 
+    my $api = 'open-ils.pcrud.delete.';
+    $api .= $cur_rec_type eq 'auth' ? 'vqar' : 'vqbr';
+
     foreach (@cleanup_recs) {
         eval {
-            $pcrud->request(
-                'open-ils.pcrud.delete.vqbr', $authtoken, $_)->recv;
+            $pcrud->request($api, $authtoken, $_)->recv;
         };
 
         if ($@) {