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.
$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};
$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;
};
}