]> Sergey Matveev's repositories - public-inbox.git/commitdiff
miscidx: cleanup git processes after manifest indexing
authorEric Wong <e@80x24.org>
Mon, 23 Nov 2020 07:05:58 +0000 (07:05 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Nov 2020 05:03:55 +0000 (05:03 +0000)
We shouldn't leave "cat-file --batch" processes around when
we're done with an epoch or inbox, since there could be
many thousands.

lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/MiscIdx.pm

index 708f8a3e96cf4aa32674bf3f2a91dfa8288c4f0c..890ac28283d27f1050e9e605743e95b0ec5d2e23 100644 (file)
@@ -311,6 +311,7 @@ sub _sync_inbox ($$$) {
        }
        index_todo($self, $sync, $_) for @{delete($sync->{todo}) // []};
        $self->{midx}->index_ibx($ibx);
+       $ibx->git->cleanup; # done with this inbox, now
 }
 
 sub eidx_sync { # main entry point
index 9dcc96b7e8cb4a06c6fc64262051d57ce71aa5a2..acb49ce79acf041f43f76f050a07572d634e6c1b 100644 (file)
@@ -107,6 +107,7 @@ EOF
                        if (my $ent = $git->manifest_entry($epoch, $desc)) {
                                $data->{"$pfx$epoch.git"} = $ent;
                        }
+                       $git->cleanup; # ->modified starts cat-file --batch
                }
        } elsif (my $ent = $ibx->git->manifest_entry) { # v1
                $data->{"/$ibx->{name}"} = $ent;