[Bast-commits] r5521 -
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated
jnapiorkowski at dev.catalyst.perl.org
jnapiorkowski at dev.catalyst.perl.org
Wed Feb 18 19:35:19 GMT 2009
Author: jnapiorkowski
Date: 2009-02-18 19:35:19 +0000 (Wed, 18 Feb 2009)
New Revision: 5521
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
Log:
I guess ensure_connected does not have a return value... so I cannot use it. Fix for replication issue where replicants always get marked as unavailable even when there is no problem with them
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm 2009-02-18 19:19:28 UTC (rev 5520)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm 2009-02-18 19:35:19 UTC (rev 5521)
@@ -187,17 +187,19 @@
sub _safely_ensure_connected {
my ($self, $replicant, @args) = @_;
- my $return; eval {
- $return = $replicant->ensure_connected(@args);
- }; if ($@) {
+ eval {
+ $replicant->ensure_connected(@args);
+ };
+ if ($@) {
$replicant
- ->debugobj
- ->print(
- sprintf( "Exception trying to ->ensure_connected for replicant %s, error is %s",
- $self->_dbi_connect_info->[0], $@)
+ ->debugobj
+ ->print(
+ sprintf( "Exception trying to ->ensure_connected for replicant %s, error is %s",
+ $replicant->_dbi_connect_info->[0], $@)
);
+ return;
}
- return $return;
+ return 1;
}
=head2 connected_replicants
More information about the Bast-commits
mailing list