Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…Database into jamesrusso-master
  • Loading branch information
ambs committed Jan 24, 2016
2 parents e14f0ba + 3ba8241 commit 0a1bc36
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Shared/lib/Dancer/Plugin/Database/Core.pm
Expand Up @@ -328,8 +328,16 @@ sub _get_connection {
sub _check_connection {
my $dbh = shift;
return unless $dbh;
if ($dbh->{Active} && (my $result = $dbh->ping)) {
if (int($result)) {
if ($dbh->{Active}) {
my $result = undef;

eval {
$result = $dbh->ping;
};

return 0 if $@;

if (int($result)) {
# DB driver itself claims all is OK, trust it:
return 1;
} else {
Expand Down

0 comments on commit 0a1bc36

Please sign in to comment.