diff options
author | Eric Wong <e@80x24.org> | 2016-07-07 01:39:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-07 01:41:03 +0000 |
commit | 8e85257577ee4d7d49e59f048852d9d4ac6f8172 (patch) | |
tree | 83b62c2c283df344a6884cc45a5e16aad5c2196b /lib/PublicInbox/NNTP.pm | |
parent | 0cdb0320181606c9b663aa8e37d69a79bff6f3a1 (diff) | |
download | public-inbox-8e85257577ee4d7d49e59f048852d9d4ac6f8172.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 17 |
1 files changed, 0 insertions, 17 deletions
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; } |