This commit is contained in:
2021-02-15 10:59:13 +08:00
parent 00a43a2563
commit adfff248e7
+6 -1
View File
@@ -42,6 +42,8 @@ abstract class Pool extends Component
$this->max = (int)$max;
}
/**
* @param $name
* @return array
@@ -52,7 +54,7 @@ abstract class Pool extends Component
if (!Context::inCoroutine()) {
return [0, null];
}
[$timeout, $connection] = $this->_items[$name]->pop(30);
[$timeout, $connection] = $this->_items[$name]->pop(-1);
if (empty($timeout) || empty($connection)) {
return [0, null];
}
@@ -63,6 +65,8 @@ abstract class Pool extends Component
}
}
/**
* @param $cds
* @param false $isMaster
@@ -133,6 +137,7 @@ abstract class Pool extends Component
Context::deleteId('create:connect:' . $coroutineName);
return $client;
}
$this->push($coroutineName, $client);
Context::deleteId('create:connect:' . $coroutineName);