xap_rw => undef, # PublicInbox::V2SearchIdx
xap_ro => undef,
partitions => $nparts,
+ parallel => 1,
transact_bytes => 0,
lock_path => "$dir/inbox.lock",
# limit each repo to 1GB or so
my $nparts = $self->{partitions};
my $part = $num % $nparts;
my $idx = $self->idx_part($part);
- $idx->index_raw($len, $msgref, $num, $oid, $mid0);
+ $idx->index_raw($len, $msgref, $num, $oid, $mid0, $mime);
my $n = $self->{transact_bytes} += $len;
if ($n > (PublicInbox::SearchIdx::BATCH_BYTES * $nparts)) {
$self->checkpoint;
sub done {
my ($self) = @_;
+ my $locked = defined $self->{idx_parts};
my $im = delete $self->{im};
$im->done if $im; # PublicInbox::Import::done
$self->searchidx_checkpoint(0);
- $self->lock_release;
+ $self->lock_release if $locked;
}
sub checkpoint {
# Now deal with Xapian
$skel->barrier_init(scalar(@$parts));
# each partition needs to issue a barrier command to skel:
- $_->barrier foreach @$parts;
+ $_->remote_barrier foreach @$parts;
$skel->barrier_wait; # wait for each Xapian partition