Эх сурвалжийг харах

Fix #40 - getppid and hup that mutt

George S. Baugh 5 жил өмнө
parent
commit
4b51c16f2d

+ 4 - 1
lib/Trog/Routes/HTML.pm

@@ -455,7 +455,10 @@ sub config_save ($query, $render_cb) {
         $query->{failure} = 0;
         $query->{message} = "Configuration updated succesfully.";
     }
-    # TODO we need to soft-restart the server at this point.  Maybe we can just hot-load config on each page when we get to have static renders?  Probably not worth the perf hit for paywall users.
+    #Get the PID of the parent port using lsof, send HUP
+    my $parent = getppid;
+    kill 'HUP', $parent;
+
     return config($query, $render_cb);
 }
 

+ 1 - 1
www/server.psgi

@@ -130,7 +130,7 @@ my $app = sub {
     $query->{user}   = $active_user;
     $query->{domain} = $env->{HTTP_HOST};
     $query->{route}  = $path;
-    $query->{scheme}  = $env->{'psgi.url_scheme'} // 'http';
+    $query->{scheme} = $env->{'psgi.url_scheme'} // 'http';
 
     my $output =  $routes{$path}{callback}->($query, \&_render);
     return $output;