]> 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 025487d2155c70fdafbc4b86a4e277739532901e..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);
        }
 }