[Bps-public-commit] r15886 - in Pushmi/trunk: Pushmi-Admin/lib/Pushmi/Admin Pushmi-Admin/share/web/static/css

alexmv at bestpractical.com alexmv at bestpractical.com
Tue Sep 9 21:04:44 EDT 2008


Author: alexmv
Date: Tue Sep  9 21:04:43 2008
New Revision: 15886

Modified:
   Pushmi/trunk/   (props changed)
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Dispatcher.pm
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
   Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css

Log:
 r37112 at kohr-ah:  chmrr | 2008-09-09 21:04:03 -0400
  * Explode if we can't talk to a memcached


Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Dispatcher.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Dispatcher.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Dispatcher.pm	Tue Sep  9 21:04:43 2008
@@ -4,6 +4,13 @@
 package Pushmi::Admin::Dispatcher;
 use Jifty::Dispatcher -base;
 
+# Check that we have a running memcached, or things get sad
+before qr{^/(?!static|errors|__jifty|favicon.ico)} => run {
+    my $memcached = $Jifty::DBI::Record::Memcached::MEMCACHED;
+    return if $memcached->get_sock("");
+    redirect '/errors/memcached';
+};
+
 on '/created' => run {
     if (    Jifty->web->response->result("create")
         and Jifty->web->response->result("create")->success )

Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm	Tue Sep  9 21:04:43 2008
@@ -490,3 +490,26 @@
     Jifty->handler->apache->send_http_header;
     $replica->dump;
 };
+
+template 'errors/memcached' => page { title => "Memcached is not running" } content {
+    my %config = Jifty::DBI::Record::Memcached->memcached_config;
+    div { { class is "pageerror"};
+        h2 { outs "The "; tt { "memcached"}; outs " server is not running"};
+        p {
+            outs "Pushmi uses the ";
+            tt { "memcached" };
+            outs " server to control locks, caching, and other needed services.  "
+                . "However, we cannot find a server running on @{$config{servers}}.";
+        };
+        p {
+            outs "Check that the ";
+            tt { "memcached" };
+            outs " server is running, then ";
+            hyperlink( url => "/", label => "try again" );
+            outs ".";
+        }
+    };
+};
+
+1;
+

Modified: Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css	(original)
+++ Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css	Tue Sep  9 21:04:43 2008
@@ -109,7 +109,7 @@
   padding: 0.5em;
 }
 
-.warning {
+.warning, div.pageerror {
   background-color: #211;
   color: #c00;
   -moz-border-radius: 5px; -webkit-border-radius: 5px;
@@ -121,6 +121,15 @@
   background-image: url(/static/images/silk/error.png);
 }
 
+div.pageerror { 
+  margin-top: 10em;
+  background-position: 15px 15px;
+}
+
+div.pageerror h2 {
+  margin-top: 0;
+}
+
 /* Rounded boxes and titles */
 
 .roundbox {



More information about the Bps-public-commit mailing list