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-28 14:56:17 +0000
committerEric Wong <e@80x24.org>2023-11-29 02:13:19 +0000
commita1ff0b13f09e2a959de692e3f29ab52502a76abd (patch)
treefbfc15fc9a121e15f5906efdb803119b3dd1d102 /lib/PublicInbox/Git.pm
parentf1e472e1851b708750c7ac0927792fb38e22b8e9 (diff)
downloadpublic-inbox-a1ff0b13f09e2a959de692e3f29ab52502a76abd.tar.gz
solver: schedule cleanup after synchronous git->check
We don't want hundreds of git cat-file processes for coderepos
lingering around.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm7
1 files changed, 6 insertions, 1 deletions
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;