From: Eric Wong (Contractor, The Linux Foundation) Date: Sat, 7 Apr 2018 03:41:51 +0000 (+0000) Subject: index: allow specifying --jobs=0 to disable multiprocess X-Git-Tag: v1.1.0-pre1~40 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=768b3d926e92c4df2274b0167613574eae808f0d;p=public-inbox.git index: allow specifying --jobs=0 to disable multiprocess Not everybody needs multiprocess support. --- diff --git a/script/public-inbox-index b/script/public-inbox-index index 73f88ac6..db7ebbab 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -31,7 +31,7 @@ my %opts = ( '--prune' => \$prune, ); GetOptions(%opts) or die "bad command-line args\n$usage"; -die "--jobs must be positive\n" if defined $jobs && $jobs <= 0; +die "--jobs must be positive\n" if defined $jobs && $jobs < 0; my @dirs; @@ -101,11 +101,11 @@ sub index_dir { eval { require PublicInbox::V2Writable }; die "v2 requirements not met: $@\n" if $@; my $v2w = eval { - local $ENV{NPROC} = $jobs; + local $ENV{NPROC} = $jobs if $jobs; PublicInbox::V2Writable->new($repo); }; if (defined $jobs) { - if ($jobs == 1) { + if ($jobs == 0) { $v2w->{parallel} = 0; } else { my $n = $v2w->{partitions};