about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-01 06:31:48 +0000
committerEric Wong <e@80x24.org>2023-11-01 08:38:59 +0000
commitb55283692989f6b21ec287edbd043e76b3d78cbf (patch)
tree8d6bd3352ff968f58dec1c25ea8662f5bd37d10e /lib/PublicInbox/Git.pm
parent01d05ebd3516e6d6cbb9223560560c0108430d79 (diff)
downloadpublic-inbox-b55283692989f6b21ec287edbd043e76b3d78cbf.tar.gz
This is necessary to reliably cleanup cat-file processes for
coderepos in long-lived -netd and -httpd processes if they
haven't been accessed in a while.

Followup-to: 33e99002c552 (git: cleanup un-associated coderepo processes)
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index a1d52118..191e4eea 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -476,7 +476,8 @@ sub async_wait_all ($) {
 # returns true if there are pending "git cat-file" processes
 sub cleanup {
         my ($self, $lazy) = @_;
-        return 1 if $lazy && _active($self);
+        ($lazy && _active($self)) and
+                return $self->{epwatch} ? watch_async($self) : 1;
         local $in_cleanup = 1;
         async_wait_all($self);
         $_->close for ($self, (delete($self->{ck}) // ()));