about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-28 14:56:17 +0000
committerEric Wong <e@80x24.org>2023-11-29 02:13:19 +0000
commita1ff0b13f09e2a959de692e3f29ab52502a76abd (patch)
treefbfc15fc9a121e15f5906efdb803119b3dd1d102 /lib/PublicInbox/SolverGit.pm
parentf1e472e1851b708750c7ac0927792fb38e22b8e9 (diff)
downloadpublic-inbox-a1ff0b13f09e2a959de692e3f29ab52502a76abd.tar.gz
solver: schedule cleanup after synchronous git->check
We don't want hundreds of git cat-file processes for coderepos
lingering around.
Diffstat (limited to 'lib/PublicInbox/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index ba3c94cb..7cc10198 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -82,7 +82,10 @@ sub solve_existing ($$) {
         my $try = $want->{try_gits} //= [ @{$self->{gits}} ]; # array copy
         my $git = shift @$try or die 'BUG {try_gits} empty';
         my $oid_b = $want->{oid_b};
+
+        # can't use async_check due to last_check_err :<
         my ($oid_full, $type, $size) = $git->check($oid_b);
+        $git->schedule_cleanup if $self->{psgi_env}->{'pi-httpd.async'};
 
         if ($oid_b eq ($oid_full // '') || (defined($type) &&
                                 (!$self->{have_hints} || $type eq 'blob'))) {