]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei-daemon: prefer graceful shutdowns
authorEric Wong <e@80x24.org>
Sun, 21 Feb 2021 18:28:15 +0000 (00:28 +0600)
committerEric Wong <e@80x24.org>
Mon, 22 Feb 2021 00:52:32 +0000 (00:52 +0000)
We'll keep the daemon alive as long as a a script/lei client
remains connected.  This ought to improve user experience
and is in line with what -imapd/-httpd/-nntpd users have
expected over the years.

lib/PublicInbox/LEI.pm

index 0b4bc20e64a18544b4509026a9845d8b1ee15b95..8d49b212baf677426857081d99ab83b0e7229673 100644 (file)
@@ -1101,6 +1101,8 @@ sub lazy_start {
        exit($exit_code // 0);
 }
 
+sub busy { 1 } # prevent daemon-shutdown if client is connected
+
 # for users w/o Socket::Msghdr installed or Inline::C enabled
 sub oneshot {
        my ($main_pkg) = @_;