]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/V2Writable.pm
v2writable: do not clobber {shards} or {parallel} if unset
[public-inbox.git] / lib / PublicInbox / V2Writable.pm
index 37d27302565e17b66586b00e5742a6b2ef451f41..72d8d5af6641aac8e0080132a92d26a11642c173 100644 (file)
@@ -107,8 +107,11 @@ sub new {
 
 # public (for now?)
 sub init_inbox {
-       my ($self, $parallel, $skip_epoch) = @_;
-       $self->{parallel} = $parallel;
+       my ($self, $shards, $skip_epoch) = @_;
+       if (defined $shards) {
+               $self->{parallel} = 0 if $shards == 0;
+               $self->{shards} = $shards if $shards > 0;
+       }
        $self->idx_init;
        my $epoch_max = -1;
        git_dir_latest($self, \$epoch_max);