Skip to content

Commit

Permalink
Merge pull request #31 from marcioAlmada/master
Browse files Browse the repository at this point in the history
Fix connection pool recovery
  • Loading branch information
bwoebi authored Apr 7, 2017
2 parents 21801b0 + 3eb0c5f commit 939f135
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct($config, $sslOptions = null) {
$restore = static function($init) use ($hash, $config) {
$cb = $config->restore;
if (isset($cb)) {
$cb($hash, $init);
return $cb($hash, $init);
}
};
$this->processor = new Processor($ready, $busy, $restore);
Expand Down
6 changes: 3 additions & 3 deletions lib/Stmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private function conn() {
}
$restore = $this->conn->restore;
if (isset($restore)) {
$restore()->prepare($this->query)->when(function($error, $stmt) {
$restore(false)->prepare($this->query)->when(function($error, $stmt) {
if ($error) {
while (list(, $args) = $this->virtualConn->getCall()) {
end($args)->fail($error);
Expand All @@ -55,7 +55,7 @@ private function conn() {
$args[0] = $this->stmtId;
}
if ($method == "execute") {
$args[1] = &$this->result->params;
$args[2] = &$this->result->params;
}
call_user_func_array([$this->conn(), $method], $args)->when(function($error, $result) use ($deferred) {
if ($error) {
Expand Down Expand Up @@ -183,4 +183,4 @@ public function __debugInfo() {

return (array) $tmp;
}
}
}

0 comments on commit 939f135

Please sign in to comment.