LP 1768715: Use named arguments in function calls in pingest.pl.
authorJason Stephenson <jason@sigio.com>
Wed, 4 Oct 2017 16:55:05 +0000 (12:55 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 23 Aug 2018 16:27:54 +0000 (12:27 -0400)
This makes it work, more or less, with Evergreen 3.0 and the changes
to metabib.reingest_field_entries.  Note that the new skip_display
parameter is not set, so you might get collisions between the browse
ingest and one of the other ingest processes if they both work on the
same record at once.

I will make a branch for use with Evergreen 3.0 until I upgrade to
Evergreen 3.0 and merge that branch into master.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>

Open-ILS/src/support-scripts/pingest.pl

index 3d0a7ce..eb5434e 100755 (executable)
@@ -236,7 +236,7 @@ sub browse_ingest {
     } elsif ($pid == 0) {
         my $dbh = DBI->connect("DBI:Pg:database=$db_db;host=$db_host;port=$db_port;application_name=pingest",
                                $db_user, $db_password);
-        my $sth = $dbh->prepare("SELECT metabib.reingest_metabib_field_entries(?, TRUE, FALSE, TRUE)");
+        my $sth = $dbh->prepare('SELECT metabib.reingest_metabib_field_entries(bib_id => ?, skip_facet => TRUE, skip_browse => FALSE, skip_search => TRUE)');
         foreach (@list) {
             if ($sth->execute($_)) {
                 my $crap = $sth->fetchall_arrayref();
@@ -278,7 +278,7 @@ sub reingest {
 sub reingest_field_entries {
     my $dbh = shift;
     my $list = shift;
-    my $sth = $dbh->prepare("SELECT metabib.reingest_metabib_field_entries(?, ?, TRUE, ?)");
+    my $sth = $dbh->prepare('SELECT metabib.reingest_metabib_field_entries(bib_id => ?, skip_facet => ?, TRUE, skip_search => ?)');
     # Because reingest uses "skip" options we invert the logic of do variables.
     $sth->bind_param(2, ($skip_facets) ? 1 : 0);
     $sth->bind_param(3, ($skip_search) ? 1 : 0);
@@ -297,7 +297,7 @@ sub reingest_attributes {
     my $dbh = shift;
     my $list = shift;
     my $sth = $dbh->prepare(<<END_OF_INGEST
-SELECT metabib.reingest_record_attributes(id, NULL::TEXT[], marc)
+SELECT metabib.reingest_record_attributes(rid => id, prmarc => marc)
 FROM biblio.record_entry
 WHERE id = ?
 END_OF_INGEST