152 |
my $db_path = $config->{webpac}->{db_path} . '/' . $database; |
my $db_path = $config->{webpac}->{db_path} . '/' . $database; |
153 |
|
|
154 |
if ($clean) { |
if ($clean) { |
155 |
$log->info("creating new database $database in $db_path"); |
$log->info("creating new database '$database' in $db_path"); |
156 |
rmtree( $db_path ) || $log->warn("can't remove $db_path: $!"); |
rmtree( $db_path ) || $log->warn("can't remove $db_path: $!"); |
157 |
} else { |
} else { |
158 |
$log->debug("working on $database in $db_path"); |
$log->info("working on database '$database' in $db_path"); |
159 |
} |
} |
160 |
|
|
161 |
my $db = new WebPAC::Store( |
my $db = new WebPAC::Store( |
194 |
|
|
195 |
my $input_module = $config->{webpac}->{inputs}->{$type}; |
my $input_module = $config->{webpac}->{inputs}->{$type}; |
196 |
|
|
197 |
$log->info("working on input '$input->{path}' [$input->{type}] using $input_module lookup '$input->{lookup}'"); |
$log->info("working on input '$input->{name}' in $input->{path} [type: $input->{type}] using $input_module lookup '$input->{lookup}'"); |
198 |
|
|
199 |
my $input_db = new WebPAC::Input( |
my $input_db = new WebPAC::Input( |
200 |
module => $input_module, |
module => $input_module, |
296 |
eval { $indexer->finish } if ($indexer && $indexer->can('finish')); |
eval { $indexer->finish } if ($indexer && $indexer->can('finish')); |
297 |
|
|
298 |
my $dt = time() - $start_t; |
my $dt = time() - $start_t; |
299 |
$log->info("$total_rows records indexed in " . |
$log->info("$total_rows records ", $indexer ? "indexed " : "", |
300 |
sprintf("%.2f sec [%.2f rec/sec]", |
sprintf("in %.2f sec [%.2f rec/sec]", |
301 |
$dt, ($total_rows / $dt) |
$dt, ($total_rows / $dt) |
302 |
) |
) |
303 |
); |
); |