about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Daemon.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 795ab822..37aa4187 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -9,6 +9,7 @@ use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 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;
@@ -181,10 +182,11 @@ sub worker_quit {
         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