DarkPAN-Indexer
view release on metacpan or search on metacpan
lib/DarkPAN/Indexer.pm view on Meta::CPAN
$storage->publish_index( $db_file, $index );
return $stats;
}
########################################################################
# update_index: incrementally re-index ONE distribution.
# retrieve current index -> open it -> format->update_index(that dist)
# -> publish. Locked for the whole read-modify-write.
########################################################################
sub update_index {
########################################################################
my ( $self, %args ) = @_;
my $distribution = $args{distribution}
or croak "ERROR: update_index requires a distribution\n";
my $storage = $self->get_storage;
my $format = $self->get_format;
my $index = $self->_index_key;
lib/DarkPAN/Indexer/Format/SQLite.pm view on Meta::CPAN
return $row_count;
}
$dbh->rollback;
$dbh->disconnect;
croak $err;
}
########################################################################
sub update_index {
########################################################################
my ( $self, %args ) = @_;
my ( $distribution, $database, $delete_only, $fetch ) = @args{qw(distribution database delete_only fetch)};
my $dbh = DBI->connect( "dbi:SQLite:dbname=$database", q{}, q{}, { AutoCommit => 1, RaiseError => 1, PrintError => 0 } );
$dbh->do( 'delete from modules where distribution = ?', undef, $distribution );
return if $delete_only;
( run in 0.896 second using v1.01-cache-2.11-cpan-1236ad508bc )