[Bps-public-commit] r15693 - in Pushmi/trunk: . lib/Pushmi lib/Pushmi/Command

alexmv at bestpractical.com alexmv at bestpractical.com
Tue Sep 2 12:18:23 EDT 2008


Author: alexmv
Date: Tue Sep  2 12:18:22 2008
New Revision: 15693

Modified:
   Pushmi/trunk/   (props changed)
   Pushmi/trunk/lib/Pushmi/Apache/AuthCommit.pm
   Pushmi/trunk/lib/Pushmi/Command/Sync.pm
   Pushmi/trunk/lib/Pushmi/Config.pm

Log:
 r36782 at kohr-ah:  chmrr | 2008-09-02 12:18:15 -0400
  * Explode if memcached connection fails, instead of silently wedging


Modified: Pushmi/trunk/lib/Pushmi/Apache/AuthCommit.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Apache/AuthCommit.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Apache/AuthCommit.pm	Tue Sep  2 12:18:22 2008
@@ -9,8 +9,6 @@
 use Apache2::RequestRec ();
 use Apache2::Const -compile => qw(FORBIDDEN OK HTTP_UNAUTHORIZED DECLINED);
 
-my $memd;
-
 sub handler {
     my $r      = shift;
     my $method = $r->method;

Modified: Pushmi/trunk/lib/Pushmi/Command/Sync.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Command/Sync.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Command/Sync.pm	Tue Sep  2 12:18:22 2008
@@ -15,8 +15,6 @@
 sub run_with_auth {
     my ($self, $repospath) = @_;
 
-    my $memd = Pushmi::Config->memcached;
-
     my $pushmi = Pushmi::Mirror->new( path => $repospath );
     $pushmi->ensure_consistency;
 

Modified: Pushmi/trunk/lib/Pushmi/Config.pm
==============================================================================
--- Pushmi/trunk/lib/Pushmi/Config.pm	(original)
+++ Pushmi/trunk/lib/Pushmi/Config.pm	Tue Sep  2 12:18:22 2008
@@ -31,12 +31,14 @@
 }
 
 sub memcached {
-    return Cache::Memcached->new(
+    my $m = Cache::Memcached->new(
         {   'servers' =>
                 [ "127.0.0.1:" . (Pushmi::Config->config->{authproxy_port} || 7123) ],
             'debug' => 0
         }
     );
+    $m->set_cb_connect_fail( sub { die "Memcached connection failed!\n" });
+    return $m;
 
 }
 



More information about the Bps-public-commit mailing list