[Jifty-commit] r4070 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Sep 10 22:04:32 EDT 2007
Author: jesse
Date: Mon Sep 10 22:04:29 2007
New Revision: 4070
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Schema.pm
Log:
r67092 at pinglin: jesse | 2007-09-10 18:26:34 -0400
* Some databases have schema creation single-threadedness. If they block, wait and retry for up to a minute
Modified: jifty/trunk/lib/Jifty/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Schema.pm Mon Sep 10 22:04:29 2007
@@ -299,7 +299,15 @@
my %connect_args;
$connect_args{'database'} = 'template1' if ( $handle->isa("Jifty::DBI::Handle::Pg") );
$connect_args{'database'} = '' if ( $handle->isa("Jifty::DBI::Handle::mysql") );
+ for(1..50) {
+ my $counter = $_;
+ eval {
$handle->connect(%connect_args);
+ };
+ my $err = $@;
+ last if( !$err || $err =~ /does not exist/i);
+ sleep 1;
+ }
return $handle;
}
More information about the Jifty-commit
mailing list