改名
This commit is contained in:
@@ -218,7 +218,8 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
private function search($type)
|
private function search($type)
|
||||||
{
|
{
|
||||||
if (!(($connect = $this->db->getConnect($this->sql)) instanceof PDO)) {
|
$connect = $this->db->getConnect($this->sql);
|
||||||
|
if (!($connect instanceof PDO)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!($query = $connect->query($this->sql))) return null;
|
if (!($query = $connect->query($this->sql))) return null;
|
||||||
|
|||||||
@@ -198,9 +198,6 @@ class Connection extends Pool
|
|||||||
*/
|
*/
|
||||||
public function getConnection(array $config, $isMaster = false)
|
public function getConnection(array $config, $isMaster = false)
|
||||||
{
|
{
|
||||||
if ($this->creates === 0) {
|
|
||||||
$this->creates = Timer::tick(10000, [$this, 'Heartbeat_detection']);
|
|
||||||
}
|
|
||||||
$coroutineName = $this->name($config['cds'], $isMaster);
|
$coroutineName = $this->name($config['cds'], $isMaster);
|
||||||
if (!isset($this->hasCreate[$coroutineName])) {
|
if (!isset($this->hasCreate[$coroutineName])) {
|
||||||
$this->hasCreate[$coroutineName] = 0;
|
$this->hasCreate[$coroutineName] = 0;
|
||||||
@@ -243,6 +240,9 @@ class Connection extends Pool
|
|||||||
if ($number = Context::getContext('begin_' . $coroutineName, Coroutine::getCid())) {
|
if ($number = Context::getContext('begin_' . $coroutineName, Coroutine::getCid())) {
|
||||||
$number > 0 && $client->beginTransaction();
|
$number > 0 && $client->beginTransaction();
|
||||||
}
|
}
|
||||||
|
if ($this->creates === 0) {
|
||||||
|
$this->creates = Timer::tick(10000, [$this, 'Heartbeat_detection']);
|
||||||
|
}
|
||||||
return $client;
|
return $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user