commit
6e238ee3396719e578d6a90e177a71ce9f8c1ca0
("nntp: respect 3 minute idle time for shutdown")
was incomplete, and needed this change to Daemon
to be effective.
In the future, there will be more common code between
NNTP.pm and HTTP.pm
use IO::Handle;
use IO::Socket;
use Cwd qw/abs_path/;
+use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
STDOUT->autoflush(1);
STDERR->autoflush(1);
require Danga::Socket;
Danga::Socket->SetPostLoopCallback(sub {
my ($dmap, undef) = @_;
my $n = 0;
+ my $now = clock_gettime(CLOCK_MONOTONIC);
foreach my $s (values %$dmap) {
$s->can('busy') or next;
- if ($s->busy) {
+ if ($s->busy($now)) {
++$n;
} else {
# close as much as possible, early as possible