diff options
author | Eric Wong <e@80x24.org> | 2023-10-26 08:20:06 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-26 17:51:49 +0000 |
commit | 33e99002c552e38d2207c97c9bae36c756f2546c (patch) | |
tree | d2c2e5729080caf9e0998188244b9993ed44fade /lib/PublicInbox/Git.pm | |
parent | f4bb8e4e497785665b1a69c08c2325c5566c24f5 (diff) | |
download | public-inbox-33e99002c552e38d2207c97c9bae36c756f2546c.tar.gz |
It's possible to have many coderepos with no inbox association that never see git->cleanup. So instead of tying git->cleanup to inboxes, ensure it gets armed when ->watch_async is called (since it's only called in our -netd or -httpd servers).
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 9c26d8bf..f4a24f2a 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -668,8 +668,10 @@ sub event_step { # idempotently registers with DS epoll/kqueue/select/poll sub watch_async ($) { - $_[0]->{epwatch} //= do { - $_[0]->SUPER::new($_[0]->{sock}, EPOLLIN); + my ($self) = @_; + PublicInbox::DS::add_uniq_timer($self+0, 30, \&cleanup, $self, 1); + $self->{epwatch} //= do { + $self->SUPER::new($self->{sock}, EPOLLIN); \undef; } } |