]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdxShard.pm
nntp: fix STAT command
[public-inbox.git] / lib / PublicInbox / SearchIdxShard.pm
index 544268819070c675bfa9d3e2a3edc92c11ffb2a2..cb79f3dc9dfcb26499232a61beb0ffa778ec0a07 100644 (file)
@@ -11,14 +11,14 @@ use IO::Handle (); # autoflush
 use PublicInbox::Eml;
 
 sub new {
-       my ($class, $v2writable, $shard) = @_;
-       my $ibx = $v2writable->{-inbox};
+       my ($class, $v2w, $shard) = @_;
+       my $ibx = $v2w->{ibx};
        my $self = $class->SUPER::new($ibx, 1, $shard);
        # create the DB before forking:
-       $self->_xdb_acquire;
+       $self->idx_acquire;
        $self->set_indexlevel;
-       $self->_xdb_release;
-       $self->spawn_worker($v2writable, $shard) if $v2writable->{parallel};
+       $self->idx_release;
+       $self->spawn_worker($v2w, $shard) if $v2w->{parallel};
        $self;
 }
 
@@ -56,7 +56,7 @@ sub shard_worker_loop ($$$$$) {
                if ($line eq "commit\n") {
                        $self->commit_txn_lazy;
                } elsif ($line eq "close\n") {
-                       $self->_xdb_release;
+                       $self->idx_release;
                } elsif ($line eq "barrier\n") {
                        $self->commit_txn_lazy;
                        # no need to lock < 512 bytes is atomic under POSIX