# We loop until we have processed all of the batches stored in @lol
# or the maximum processing duration has been reached.
+my $last_record;
while ($count < $lists) {
my $duration_expired = duration_expired();
if (scalar(@lol) && scalar(@running) < $max_child && !$duration_expired) {
# Reuse $records for the lulz.
$records = shift(@lol);
+ $last_record = $records->[-1];
if ($skip_search && $skip_facets && $skip_attrs) {
$count++;
} else {
if (grep {$_ == $pid} @running) {
@running = grep {$_ != $pid} @running;
$count++;
- announce('DEBUG',
- "reingest() processed $count of $lists batches");
+ announce('DEBUG', "reingest() processed $count of ".
+ "$lists batches; last record = $last_record");
}
}
if ($duration_expired && scalar(@running) == 0) {
- my $last_rec = pop(@$records);
announce('INFO',
- "reingest() stopping on record $last_rec on max duration");
+ "reingest() stopping on $last_record at max duration");
exit(0);
}
}
last;
}
- announce('DEBUG',
- "browse_ingest() processed $count of $total records")
+ announce('DEBUG', "browse_ingest() processed $count ".
+ "of $total records; last record = $_")
if ++$count % $batch_size == 0;
}
$dbh->disconnect();