变更
This commit is contained in:
+6
-5
@@ -232,10 +232,10 @@ class PDO implements StopHeartbeatCheck
|
|||||||
private function queryPrev(string $sql, array $params = []): PDOStatement
|
private function queryPrev(string $sql, array $params = []): PDOStatement
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($this->_timerId === -1) {
|
// if ($this->_timerId === -1) {
|
||||||
$this->_timerId = Timer::tick(6000, [$this, 'check']);
|
// $this->_timerId = Timer::tick(6000, [$this, 'check']);
|
||||||
}
|
// }
|
||||||
$this->_last = time();
|
// $this->_last = time();
|
||||||
if (($statement = $this->_pdo()->query($sql)) === false) {
|
if (($statement = $this->_pdo()->query($sql)) === false) {
|
||||||
throw new Exception($this->_pdo()->errorInfo()[1]);
|
throw new Exception($this->_pdo()->errorInfo()[1]);
|
||||||
}
|
}
|
||||||
@@ -256,6 +256,7 @@ class PDO implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function check(): bool
|
public function check(): bool
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
try {
|
try {
|
||||||
if ($this->_last == 0) $this->_last = time();
|
if ($this->_last == 0) $this->_last = time();
|
||||||
if (time() - $this->_last >= 600) {
|
if (time() - $this->_last >= 600) {
|
||||||
@@ -263,7 +264,7 @@ class PDO implements StopHeartbeatCheck
|
|||||||
} else if (!($this->pdo instanceof \PDO)) {
|
} else if (!($this->pdo instanceof \PDO)) {
|
||||||
return $result = false;
|
return $result = false;
|
||||||
}
|
}
|
||||||
$this->pdo->getAttribute(\PDO::ATTR_SERVER_INFO);
|
$this->_pdo()->getAttribute(\PDO::ATTR_SERVER_INFO);
|
||||||
$result = true;
|
$result = true;
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
if (!str_contains($throwable->getMessage(), 'Idle dis')) {
|
if (!str_contains($throwable->getMessage(), 'Idle dis')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user