user/dev discussion of public-inbox itself
 help / Atom feed
* [PATCH] daemon: set $now time for NNTP shutdown
@ 2016-12-12 12:16 Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2016-12-12 12:16 UTC (permalink / raw)
  To: meta

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 and
 lib/PublicInbox/ | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index 795ab82..37aa418 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -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);
 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)) {
 			} else {
 				# close as much as possible, early as possible

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-12 12:16 [PATCH] daemon: set $now time for NNTP shutdown Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:
       or Tor2web:

AGPL code for this site: git clone public-inbox