Dezi-App

 view release on metacpan or  search on metacpan

lib/Dezi/Lucy/Indexer.pm  view on Meta::CPAN

    # get a lock on our header file till
    # this entire transaction is complete.
    # Note that we trust the Lucy locking feature
    # to have prevented any other process
    # from getting a lock on the invindex itself,
    # but we want to make sure nothing interrupts
    # us from writing our own header after calling ->commit().
    my $invindex  = $self->invindex;
    my $header    = $invindex->header_file->stringify;
    my $lock_file = Path::Class::File::Lockable->new($header);
    if ( $lock_file->locked ) {
        croak "Lock file found on $header -- cannot commit indexing changes";
    }
    $lock_file->lock;

    # commit our changes
    $self->{lucy}->commit();

    # get total doc count
    my $polyreader = Lucy::Index::PolyReader->open( index => "$invindex", );
    my $doc_count = $polyreader->doc_count();

lib/Dezi/Queue.pm  view on Meta::CPAN

=cut

sub remove {
    my $self = shift;
    my $v    = shift;
    return delete $self->{locks}->{$v};
}

=head2 clean

Removes all locked items from the queue.

=cut

sub clean {
    my $self = shift;
    delete $self->{locks};
}

=head2 peek



( run in 0.630 second using v1.01-cache-2.11-cpan-49f99fa48dc )