}
}
-sub git_tmp_cleanup {
- my ($git) = @_;
- $git->cleanup(1) and
- PublicInbox::DS::add_timer(3, \&git_tmp_cleanup, $git);
-}
-
sub ibx_async_cat ($$$$) {
my ($ibx, $oid, $cb, $arg) = @_;
my $git = $ibx->{git} // $ibx->git;
$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()
};
EOM
}
@{$ctx->{-paths}} = ($path, $raw_link);
+ bless $ctx, 'PublicInbox::WwwStream'; # for DESTROY
$ctx->{git} = $git;
if ($ctx->{env}->{'pi-httpd.async'}) {
ibx_async_cat($ctx, $oid, \&show_blob, $ctx);