From 8e85257577ee4d7d49e59f048852d9d4ac6f8172 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jul 2016 01:39:36 +0000 Subject: inbox: cleanup and consolidate object weakening This fixes some layering violations and consolidates the cleanup into the inbox object itself. Keeping in mind weakening does not work at all without our PSGI server. --- lib/PublicInbox/NNTP.pm | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'lib/PublicInbox/NNTP.pm') diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 56d08385..0b30d43a 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -38,8 +38,6 @@ my %DISABLED; # = map { $_ => 1 } qw(xover list_overview_fmt newnews xhdr); my $EXPMAP; # fd -> [ idle_time, $self ] my $expt; our $EXPTIME = 180; # 3 minutes -my $WEAKEN = {}; # string(nntpd) -> nntpd -my $weakt; my $nextt; my $nextq = []; @@ -64,16 +62,6 @@ sub update_idle_time ($) { defined $fd and $EXPMAP->{$fd} = [ now(), $self ]; } -# reduce FD pressure by closing some "git cat-file --batch" processes -# and unused FDs for msgmap and Xapian indices -sub weaken_groups () { - $weakt = undef; - foreach my $nntpd (values %$WEAKEN) { - $_->weaken_all foreach (@{$nntpd->{grouplist}}); - } - $WEAKEN = {}; -} - sub expire_old () { my $now = now(); my $exp = $EXPTIME; @@ -92,15 +80,11 @@ sub expire_old () { $EXPMAP = \%new; if ($nr) { $expt = PublicInbox::EvCleanup::later(*expire_old); - weaken_groups(); } else { $expt = undef; # noop to kick outselves out of the loop ASAP so descriptors # really get closed PublicInbox::EvCleanup::asap(sub {}); - - # grace period for reaping resources - $weakt ||= PublicInbox::EvCleanup::later(*weaken_groups); } } @@ -113,7 +97,6 @@ sub new ($$$) { $self->{rbuf} = ''; $self->watch_read(1); update_idle_time($self); - $WEAKEN->{"$nntpd"} = $nntpd; $expt ||= PublicInbox::EvCleanup::later(*expire_old); $self; } -- cgit v1.2.3-24-ge0c7