unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] git: reschedule cleanup if activea
@ 2023-11-01  6:31 Eric Wong
  2023-11-01  8:38 ` [PATCH] git: reschedule cleanup if active Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2023-11-01  6:31 UTC (permalink / raw)
  To: meta

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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}) // ()));

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-01  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01  6:31 [PATCH] git: reschedule cleanup if activea Eric Wong
2023-11-01  8:38 ` [PATCH] git: reschedule cleanup if active Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).