]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Xapcmd.pm
doc: re-add missing 1.6 release notes
[public-inbox.git] / lib / PublicInbox / Xapcmd.pm
index 6a74daf92b5be1e4345ce473f28a66b3db5e7f1b..269aa99af16f80da3ab3266a524978b9b32202d2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 package PublicInbox::Xapcmd;
 use strict;
@@ -89,8 +89,10 @@ sub commit_changes ($$$$) {
 
 sub cb_spawn {
        my ($cb, $args, $opt) = @_; # $cb = cpdb() or compact()
-       defined(my $pid = fork) or die "fork: $!";
+       my $seed = rand(0xffffffff);
+       my $pid = fork // die "fork: $!";
        return $pid if $pid > 0;
+       srand($seed);
        $cb->($args, $opt);
        POSIX::_exit(0);
 }
@@ -109,8 +111,7 @@ sub prepare_reindex ($$$) {
                        $opt->{reindex}->{from} = $lc;
                }
        } else { # v2
-               my $max;
-               $im->git_dir_latest(\$max) or return;
+               my $max = $ibx->max_git_epoch // return;
                my $from = $opt->{reindex}->{from};
                my $mm = $ibx->mm;
                my $v = PublicInbox::Search::SCHEMA_VERSION();
@@ -271,7 +272,6 @@ sub run {
 
        local %SIG = %SIG;
        setup_signals();
-       $ibx->umask_prepare;
        $ibx->with_umask(\&_run, $ibx, $cb, $opt);
 }