From a1ff0b13f09e2a959de692e3f29ab52502a76abd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 28 Nov 2023 14:56:17 +0000 Subject: solver: schedule cleanup after synchronous git->check We don't want hundreds of git cat-file processes for coderepos lingering around. --- lib/PublicInbox/Git.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index fe834210..7c6e15b7 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -628,10 +628,15 @@ sub event_step { } } +sub schedule_cleanup { + my ($self) = @_; + PublicInbox::DS::add_uniq_timer($self+0, 30, \&cleanup, $self, 1); +} + # idempotently registers with DS epoll/kqueue/select/poll sub watch_async ($) { my ($self) = @_; - PublicInbox::DS::add_uniq_timer($self+0, 30, \&cleanup, $self, 1); + schedule_cleanup($self); $self->{epwatch} //= do { $self->SUPER::new($self->{sock}, EPOLLIN); \undef; -- cgit v1.2.3-24-ge0c7