From: Jason Stephenson Date: Fri, 1 Apr 2016 14:02:45 +0000 (-0400) Subject: LP 1768715: Only connect to the database when needed in pingest.pl. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2da2f10b1e9f744cd57da8ced8fdb8779f1b5511;p=evergreen%2Fjoelewis.git LP 1768715: Only connect to the database when needed in pingest.pl. We chagne where we connect and disconnect the database in the parent process in pingest.pl. There's no point connecting at all if the --pipe option is used. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/support-scripts/pingest.pl b/Open-ILS/src/support-scripts/pingest.pl index 73efaab727..9c9252857b 100755 --- a/Open-ILS/src/support-scripts/pingest.pl +++ b/Open-ILS/src/support-scripts/pingest.pl @@ -140,7 +140,6 @@ sub duration_expired { # # 2) edit the DBI->connect() calls in this program so that it can # connect to your database. -my $dbh = DBI->connect('DBI:Pg:'); # Get the input records from either standard input or the database. my @input; @@ -152,7 +151,9 @@ if ($opt_pipe) { } } } else { + my $dbh = DBI->connect('DBI:Pg:'); @input = @{$dbh->selectall_arrayref($q)}; + $dbh->disconnect(); } foreach my $r (@input) { @@ -167,7 +168,6 @@ foreach my $r (@input) { } $lol[$lists++] = $records if ($count); # Last batch is likely to be # small. -$dbh->disconnect(); # We're going to reuse $count to keep track of the total number of # batches processed.