user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 10/9] inbox: properly register cleanup timer for git processes
  @ 2017-01-07  2:12  7%   ` Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2017-01-07  2:12 UTC (permalink / raw)
  To: meta

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.
---
 lib/PublicInbox/Inbox.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index aa4e141..51ada0b 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;
 	};
 }
-- 
EW

^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-01-07  1:44     [PATCH 0/9] misc cleanups and trimming Eric Wong
2017-01-07  1:44     ` [PATCH 5/9] inbox: eliminate weaken usage entirely Eric Wong
2017-01-07  2:12  7%   ` [PATCH 10/9] inbox: properly register cleanup timer for git processes Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).