This commit is contained in:
2021-04-27 10:36:56 +08:00
parent 815642bc24
commit 26dc63f63a
+4
View File
@@ -168,10 +168,14 @@ abstract class Pool extends Component
if (!Context::inCoroutine()) {
return $this->createClient($name, $callback);
}
$time = microtime(true);
if (!$this->hasItem($name)) {
$this->createByCallback($name, $callback);
}
$connection = $this->_items[$name]->pop(0.01);
if (microtime(true) - $time >= 0.007) {
$this->warning('get client use time ' . (microtime(true) - $time));
}
if (!$this->checkCanUse($name, $connection)) {
return $this->createClient($name, $callback);
} else {