]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/V2Writable.pm
extindex: -xcpdb and -compact support
[public-inbox.git] / lib / PublicInbox / V2Writable.pm
index 4c1accbbdf096da74995dfe7026baa1e4859603f..1288f47ba47013fb363030d4119d9e8e1149efe7 100644 (file)
@@ -54,14 +54,14 @@ sub nproc_shards ($) {
 
 sub count_shards ($) {
        my ($self) = @_;
+       # always load existing shards in case core count changes:
+       # Also, shard count may change while -watch is running
        if (my $ibx = $self->{ibx}) {
-               # always load existing shards in case core count changes:
-               # Also, shard count may change while -watch is running
                my $srch = $ibx->search or return 0;
                delete $ibx->{search};
                $srch->{nshard} // 0
        } else { # ExtSearchIdx
-               $self->{nshard} ||= scalar($self->xdb_shards_flat);
+               $self->{nshard} = scalar($self->xdb_shards_flat);
        }
 }
 
@@ -1279,7 +1279,7 @@ sub index_todo ($$$) {
 
 sub xapian_only {
        my ($self, $opt, $sync, $art_beg) = @_;
-       my $seq = $opt->{sequential_shard};
+       my $seq = $opt->{'sequential-shard'};
        $art_beg //= 0;
        local $self->{parallel} = 0 if $seq;
        $self->idx_init($opt); # acquire lock
@@ -1329,7 +1329,7 @@ sub index_sync {
        }
 
        my $pr = $opt->{-progress};
-       my $seq = $opt->{sequential_shard};
+       my $seq = $opt->{'sequential-shard'};
        my $art_beg; # the NNTP article number we start xapian_only at
        my $idxlevel = $self->{ibx}->{indexlevel};
        local $self->{ibx}->{indexlevel} = 'basic' if $seq;