]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: purge email address cache after rendering thread
authorEric Wong <e@80x24.org>
Tue, 1 Sep 2015 20:33:24 +0000 (20:33 +0000)
committerEric Wong <e@80x24.org>
Tue, 1 Sep 2015 20:34:52 +0000 (20:34 +0000)
We cannot allow memory in the cache to grow at an unbounded
rate in between HTTP requests.

lib/PublicInbox/View.pm

index 116f36e732374fe62fc1b7ffe79d6677136d30ff..6aa199e6de600fe4137218a8c1c84c52c691b8cb 100644 (file)
@@ -157,6 +157,7 @@ sub emit_thread_html {
                my $git = PublicInbox::GitCatFile->new($ctx->{git_dir});
                thread_entry($fh, $git, $state, $_, 0) for $th->rootset;
        }
+       Email::Address->purge_cache;
        my $final_anchor = $state->{anchor_idx};
        my $next = "<a\nid=\"s$final_anchor\">";
        $next .= $final_anchor == 1 ? 'only message in' : 'end of';