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).
# 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;
}
}
}
my $srch = $ibx->{search} // $ibx;
delete @$srch{qw(xdb qp)};
- for my $git (@{$ibx->{-repo_objs} // []}) {
- $live = 1 if $git->cleanup(1);
- }
PublicInbox::DS::add_uniq_timer($ibx+0, 5, \&do_cleanup, $ibx) if $live;
}
my $g = PublicInbox::Git->new($git_dir);
my $lim = $self->{-httpbackend_limiter};
$g->{-httpbackend_limiter} = $lim if $lim;
- _cleanup_later($self);
$g;
};
}