[Jifty-commit] jifty branch, setupwizard-refactor, updated. 8fc146262b18f7ba5d8869eb1fecd83c9ab4977e

Jifty commits jifty-commit at lists.jifty.org
Thu Jun 24 15:23:54 EDT 2010


The branch, setupwizard-refactor has been updated
       via  8fc146262b18f7ba5d8869eb1fecd83c9ab4977e (commit)
      from  f5fa09f0a30f3b45a9bbe741cb1d7eaa9516b90d (commit)

Summary of changes:
 lib/Jifty/Plugin/Config/View.pm |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 8fc146262b18f7ba5d8869eb1fecd83c9ab4977e
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jun 24 15:23:43 2010 -0400

    Reload config and DB handles when restarting and call App->restart

diff --git a/lib/Jifty/Plugin/Config/View.pm b/lib/Jifty/Plugin/Config/View.pm
index d82c82b..37fc7f0 100644
--- a/lib/Jifty/Plugin/Config/View.pm
+++ b/lib/Jifty/Plugin/Config/View.pm
@@ -45,6 +45,14 @@ This path (configurable by the C<restart_url> setting of the plugin)
 waits five seconds, then redirects to the configured
 C<after_restart_url>.
 
+The restart is accomplished by reloading the config, setting up new database
+handles (potentially using new database config and autocreating/updating the
+database), and finally calling the application's C<restart> method so
+handle any application-specific chores.
+
+It does NOT at the moment hook into L<Plack::Loader> to "fully" restart the
+server.
+
 =cut
 
 template $restart_url => sub {
@@ -102,6 +110,18 @@ EOF
     };
 
     Jifty->handler->buffer->flush_output();
+
+    # reload config
+    Jifty->config->load();
+
+    # reconnect our database handle in case that config changed
+    Jifty->setup_database_connection();
+
+    # call the app's restart method if it has one
+    my $app = Jifty->app_class;
+    $app->restart()
+        if $app->can('restart');
+
     # XXX: hook into plack::loader to restart server
 };
 

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list