if (grep {$_ == $pid} @running) {
@running = grep {$_ != $pid} @running;
$count++;
- announce('INFO', "$count of $lists processed");
+ announce('DEBUG',
+ "reingest() processed $count of $lists batches");
}
}
if ($duration_expired && scalar(@running) == 0) {
- announce('INFO', "Exiting on max_duration ($max_duration)");
+ my $last_rec = pop(@$records);
+ announce('INFO',
+ "reingest() stopping on record $last_rec on max duration");
exit(0);
}
}
} elsif ($pid == 0) {
my $dbh = DBI->connect('DBI:Pg:');
my $sth = $dbh->prepare("SELECT metabib.reingest_metabib_field_entries(?, TRUE, FALSE, TRUE)");
+ my $total = scalar(@list);
+ my $count = 0;
foreach (@list) {
if ($sth->execute($_)) {
my $crap = $sth->fetchall_arrayref();
"browse_ingest() stopping on record $_ on max duration");
last;
}
+
+ announce('DEBUG',
+ "browse_ingest() processed $count of $total records")
+ if ++$count % $batch_size == 0;
}
$dbh->disconnect();
exit(0);