From: Eric Wong Date: Wed, 1 Nov 2023 06:31:48 +0000 (+0000) Subject: git: reschedule cleanup if active X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b55283692989f6b21ec287edbd043e76b3d78cbf;p=thirdparty%2Fpublic-inbox.git git: reschedule cleanup if active 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) --- diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index a1d52118f..191e4eea4 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}) // ()));