about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-27 22:36:32 +0000
committerEric Wong <e@80x24.org>2016-02-27 22:41:32 +0000
commit10675ec65c81492fef322567db9f545d5b7d6d58 (patch)
tree1df792ead75e802e61bd18ee2209507f66052429 /lib
parente6a02743e6411d6e70e4b72e749694445f9ff6db (diff)
downloadpublic-inbox-10675ec65c81492fef322567db9f545d5b7d6d58.tar.gz
This means we always load the PSGI server code early for
-httpd.  This may make things less compatible with existing
PSGI/Plack apps, but we prioritize our httpd for the uses
of public-inbox itself, first.

And any existing PSGI/Plack app which wants to may adapt
themselves to being preload-friendly.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Daemon.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 2878e33b..b8482d36 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -363,6 +363,7 @@ sub daemon_loop ($$) {
         my ($refresh, $post_accept) = @_;
         my $parent_pipe;
         if ($worker_processes > 0) {
+                $refresh->(); # preload by default
                 $parent_pipe = master_loop(); # returns if in child process
                 my $fd = fileno($parent_pipe);
                 Danga::Socket->AddOtherFds($fd => sub { kill('TERM', $$) } );
@@ -370,10 +371,10 @@ sub daemon_loop ($$) {
                 reopen_logs();
                 $set_user->() if $set_user;
                 $SIG{USR2} = sub { worker_quit() if upgrade() };
+                $refresh->();
         }
         $uid = $gid = undef;
         reopen_logs();
-        $refresh->();
         $SIG{QUIT} = $SIG{INT} = $SIG{TERM} = *worker_quit;
         $SIG{USR1} = *reopen_logs;
         $SIG{HUP} = $refresh;