]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
git: reschedule cleanup if active
authorEric Wong <e@80x24.org>
Wed, 1 Nov 2023 06:31:48 +0000 (06:31 +0000)
committerEric Wong <e@80x24.org>
Wed, 1 Nov 2023 08:38:59 +0000 (08:38 +0000)
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)
lib/PublicInbox/Git.pm

index a1d52118fbf26001f83765a0f58eec7ee0536678..191e4eea41e46d09c6731b6f3ade7da4b904488b 100644 (file)
@@ -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}) // ()));