From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BFCDF1F518 for ; Sat, 7 Apr 2018 03:41:55 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 5/8] index: allow specifying --jobs=0 to disable multiprocess Date: Sat, 7 Apr 2018 03:41:51 +0000 Message-Id: <20180407034154.2309-6-e@80x24.org> In-Reply-To: <20180407034154.2309-1-e@80x24.org> References: <20180407034154.2309-1-e@80x24.org> List-Id: Not everybody needs multiprocess support. --- script/public-inbox-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/public-inbox-index b/script/public-inbox-index index 73f88ac..db7ebba 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}; -- EW