We don't want hundreds of git cat-file processes for coderepos
lingering around.
}
}
+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;
my $try = $want->{try_gits} //= [ @{$self->{gits}} ]; # array copy
my $git = shift @$try or die 'BUG {try_gits} empty';
my $oid_b = $want->{oid_b};
+
+ # can't use async_check due to last_check_err :<
my ($oid_full, $type, $size) = $git->check($oid_b);
+ $git->schedule_cleanup if $self->{psgi_env}->{'pi-httpd.async'};
if ($oid_b eq ($oid_full // '') || (defined($type) &&
(!$self->{have_hints} || $type eq 'blob'))) {