From 2da2f10b1e9f744cd57da8ced8fdb8779f1b5511 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 1 Apr 2016 10:02:45 -0400 Subject: [PATCH 1/1] 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 --- Open-ILS/src/support-scripts/pingest.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. -- 2.43.2