This commit is contained in:
2021-02-15 20:45:35 +08:00
parent b862e828fc
commit 74604324b1
3 changed files with 22 additions and 31 deletions
+2 -5
View File
@@ -124,13 +124,10 @@ abstract class Pool extends Component
* @return PDO|Redis|null
* @throws Exception
*/
public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|null
public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|false
{
if ($this->hasItem($coroutineName)) {
return $this->get($coroutineName)[1];
}
if (Context::hasContext('create:connect:' . $coroutineName)) {
return null;
return false;
}
Context::setContext('create:connect:' . $coroutineName, 1);