diff options
author | Eric Wong <e@80x24.org> | 2017-01-07 02:10:23 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-07 02:10:23 +0000 |
commit | f1a38b18d9a46531e18143a7cd4c7a66fc89adbc (patch) | |
tree | 023d91a72b549a5c3a6551786626497b78f1f53e /lib | |
parent | f74b64dbe75226b996367a6049ebd00a3e39ba49 (diff) | |
download | public-inbox-f1a38b18d9a46531e18143a7cd4c7a66fc89adbc.tar.gz |
We still need to cleanup git processes occasionally, since "git cat-file --batch" does not release old packs (and git processes are fairly expensive). For SQLite and Xapian file handles, they should be capable of managing themselves without too much trouble, so lets try keeping them for the lifetime of a process.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/Inbox.pm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index aa4e141f..51ada0bc 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -22,12 +22,6 @@ sub cleanup_task () { $CLEANUP = {}; } -sub _cleanup_later ($) { - my ($self) = @_; - $cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task); - $CLEANUP->{"$self"} = $self; -} - sub _set_uint ($$$) { my ($opts, $field, $default) = @_; my $val = $opts->{$field}; @@ -76,6 +70,8 @@ sub git { $self->{git} ||= eval { my $g = PublicInbox::Git->new($self->{mainrepo}); $g->{-httpbackend_limiter} = $self->{-httpbackend_limiter}; + $cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task); + $CLEANUP->{"$self"} = $self; $g; }; } |