From e3f00c42863737e588218fe904aed54449d4cf23 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 24 Sep 2015 03:37:20 +0000 Subject: nntpd: better encapsulation for shutdown We can use the UNIVERSAL::can to better encapsulate the shutdown process, in case we need to implement a gopher or HTTP daemon. --- public-inbox-nntpd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'public-inbox-nntpd') diff --git a/public-inbox-nntpd b/public-inbox-nntpd index 70bab46f..9fb69cec 100644 --- a/public-inbox-nntpd +++ b/public-inbox-nntpd @@ -204,8 +204,7 @@ sub worker_quit { my $n = 0; foreach my $s (values %$dmap) { - next unless ref($s) eq 'PublicInbox::NNTP'; - if ($s->busy) { + if ($s->can('busy') && $s->busy) { ++$n; } else { $s->close; -- cgit v1.2.3-24-ge0c7