}
}
-sub git_tmp_cleanup {
+sub watch_cat {
my ($git) = @_;
- $git->cleanup(1) and
- PublicInbox::DS::add_timer(3, \&git_tmp_cleanup, $git);
+ $git->{async_cat} //= do {
+ my $self = bless { git => $git }, __PACKAGE__;
+ $git->{in}->blocking(0);
+ $self->SUPER::new($git->{in}, EPOLLIN|EPOLLET);
+ \undef; # this is a true ref()
+ };
}
sub ibx_async_cat ($$$$) {
\undef;
} else { # read-only end of git-cat-file pipe
$git->cat_async($oid, $cb, $arg);
- $git->{async_cat} //= do {
- my $self = bless { git => $git }, __PACKAGE__;
- $git->{in}->blocking(0);
- $git->{-tmp} and PublicInbox::DS::add_uniq_timer(
- 3, \&git_tmp_cleanup, $git);
- $self->SUPER::new($git->{in}, EPOLLIN|EPOLLET);
- \undef; # this is a true ref()
- };
+ watch_cat($git);
}
}