about summary refs log tree commit homepage
path: root/lib/PublicInbox/ViewVCS.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/ViewVCS.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/ViewVCS.pm')
-rw-r--r--lib/PublicInbox/ViewVCS.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm
index 915cf2c5..b0f58455 100644
--- a/lib/PublicInbox/ViewVCS.pm
+++ b/lib/PublicInbox/ViewVCS.pm
@@ -414,6 +414,7 @@ blob $oid $size bytes $raw_link</pre>
 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);