about summary refs log tree commit homepage
path: root/lib/PublicInbox/GitAsyncCat.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-01 15:52:50 -0300
committerEric Wong <e@80x24.org>2022-10-01 23:02:18 +0000
commitac22adc97342323e056bb36f9434458cc822e7d9 (patch)
treef6d3ac9563a203668e3a57b97085335035b12b89 /lib/PublicInbox/GitAsyncCat.pm
parentfa04201baae9d1043e37cf8ef4e5a33fdd0498ff (diff)
downloadpublic-inbox-ac22adc97342323e056bb36f9434458cc822e7d9.tar.gz
Relying on a timer to handle cleanup in f9ac22a4b485 was
sub-optimal since the delay could prove expensive under heavy
traffic.  So rely on ->DESTROY instead since we we no longer
hold reference cycles by the time the show_blob callback
executes.

Fixes: f9ac22a4b485 ("git_async_cat: automatically cleanup temporary gits")
Diffstat (limited to 'lib/PublicInbox/GitAsyncCat.pm')
-rw-r--r--lib/PublicInbox/GitAsyncCat.pm8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/PublicInbox/GitAsyncCat.pm b/lib/PublicInbox/GitAsyncCat.pm
index 2d601542..b32c2fd3 100644
--- a/lib/PublicInbox/GitAsyncCat.pm
+++ b/lib/PublicInbox/GitAsyncCat.pm
@@ -45,12 +45,6 @@ sub event_step {
         }
 }
 
-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;
@@ -69,8 +63,6 @@ sub ibx_async_cat ($$$$) {
                 $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()
                 };