diff options
Diffstat (limited to 'lib/PublicInbox/ExtSearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/ExtSearchIdx.pm | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 763a124c..934197c0 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -543,13 +543,7 @@ sub _ibx_for ($$$) { sub _fd_constrained ($) { my ($self) = @_; $self->{-fd_constrained} //= do { - my $soft; - if (eval { require BSD::Resource; 1 }) { - my $NOFILE = BSD::Resource::RLIMIT_NOFILE(); - ($soft, undef) = BSD::Resource::getrlimit($NOFILE); - } else { - chomp($soft = `sh -c 'ulimit -n'`); - } + my $soft = PublicInbox::Search::ulimit_n; if (defined($soft)) { # $want is an estimate my $want = scalar(@{$self->{ibx_active}}) + 64; @@ -1287,11 +1281,11 @@ sub idx_init { # similar to V2Writable ($has_new || $prune_nr || $new ne '') and $self->{mg}->write_alternates($mode, $alt, $new); my $restore = $self->with_umask; - if ($git_midx) { - my @cmd = ('multi-pack-index'); - push @cmd, '--no-progress' if ($opt->{quiet}//0) > 1; + if ($git_midx && ($opt->{'multi-pack-index'} // 1)) { + my $cmd = $self->git->cmd('multi-pack-index'); + push @$cmd, '--no-progress' if ($opt->{quiet}//0) > 1; my $lk = $self->lock_for_scope; - system('git', "--git-dir=$ALL", @cmd, 'write'); + system(@$cmd, 'write'); # ignore errors, fairly new command, may not exist } $self->parallel_init($self->{indexlevel}); |