Skip to content

Commit

Permalink
optimize checking pdo alive
Browse files Browse the repository at this point in the history
  • Loading branch information
hhxsv5 committed May 29, 2020
1 parent 5c18317 commit f9289cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/coroutine-runtime-pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'options' => [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_TIMEOUT => 30,
],
]
);
Expand Down
1 change: 1 addition & 0 deletions examples/dynamic-testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'options' => [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_TIMEOUT => 30,
],
]
);
Expand Down
2 changes: 1 addition & 1 deletion src/Connectors/PDOConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function isConnected($connection): bool
{
/**@var \PDO $connection */
try {
return !!$connection->getAttribute(\PDO::ATTR_SERVER_INFO);
return !!@$connection->getAttribute(\PDO::ATTR_SERVER_INFO);
} catch (\Throwable $e) {
return false;
}
Expand Down

0 comments on commit f9289cb

Please sign in to comment.