diff options
author | Eric Wong <e@80x24.org> | 2023-10-04 03:49:14 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-04 17:46:30 +0000 |
commit | 2f946a02bc324612febdfe31604b79e0196a215f (patch) | |
tree | a225827b35718f40cd0d6c50d584895e211a5ae1 /lib/PublicInbox/Daemon.pm | |
parent | 1cbad18d329faad67c85f4d56f79afc80a2c80c4 (diff) | |
download | public-inbox-2f946a02bc324612febdfe31604b79e0196a215f.tar.gz |
It's shared by both by lei and public-facing daemons in using the ->busy callback.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r-- | lib/PublicInbox/Daemon.pm | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 7546105e..5250610b 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -364,16 +364,8 @@ sub worker_quit { # $_[0] = signal name or number (unused) # drop idle connections and try to quit gracefully @PublicInbox::DS::post_loop_do = (sub { my ($dmap, undef) = @_; - my $n = 0; my $now = now(); - for my $s (values %$dmap) { - $s->can('busy') or next; - if ($s->busy) { - ++$n; - } else { # close as much as possible, early as possible - $s->close; - } - } + my $n = PublicInbox::DS::close_non_busy(); if ($n) { if (($warn + 5) < now()) { warn "$$ quitting, $n client(s) left\n"; |