]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Daemon.pm
imapd+nntpd: drop timer-based expiration
[public-inbox.git] / lib / PublicInbox / Daemon.pm
index 0acd4ee9946c4d8f5dd29a25a6eddab0ef5f97c1..505235864c0b22166841eb4c3b54c72f3e0abc29 100644 (file)
@@ -6,8 +6,8 @@
 # and/or lossy connections.
 package PublicInbox::Daemon;
 use strict;
-use warnings;
-use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
+use v5.10.1;
+use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use IO::Handle; # ->autoflush
 use IO::Socket;
 use POSIX qw(WNOHANG :signal_h);
@@ -15,11 +15,12 @@ use Socket qw(IPPROTO_TCP SOL_SOCKET);
 STDOUT->autoflush(1);
 STDERR->autoflush(1);
 use PublicInbox::DS qw(now);
-require PublicInbox::Listener;
+use PublicInbox::Listener;
 use PublicInbox::EOFpipe;
 use PublicInbox::Sigfd;
 use PublicInbox::Git;
 use PublicInbox::GitAsyncCat;
+use PublicInbox::Eml;
 our $SO_ACCEPTFILTER = 0x1000;
 my @CMD;
 my ($set_user, $oldset);
@@ -270,13 +271,11 @@ sub worker_quit { # $_[0] = signal name or number (unused)
                my ($dmap, undef) = @_;
                my $n = 0;
                my $now = now();
-
-               foreach my $s (values %$dmap) {
+               for my $s (values %$dmap) {
                        $s->can('busy') or next;
-                       if ($s->busy($now)) {
+                       if ($s->busy) {
                                ++$n;
-                       } else {
-                               # close as much as possible, early as possible
+                       } else { # close as much as possible, early as possible
                                $s->close;
                        }
                }
@@ -642,6 +641,7 @@ sub run ($$$;$) {
        # localize GCF2C for tests:
        local $PublicInbox::GitAsyncCat::GCF2C;
        local $PublicInbox::Git::async_warn = 1;
+       local $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb();
 
        daemon_loop($refresh, $post_accept, $tlsd, $af_default);
        PublicInbox::DS->Reset;