modify plugin name
This commit is contained in:
+7
-3
@@ -25,8 +25,7 @@ class PDO implements StopHeartbeatCheck
|
|||||||
|
|
||||||
private int $_transaction = 0;
|
private int $_transaction = 0;
|
||||||
|
|
||||||
|
private int $_last = 0;
|
||||||
private int $_timer = -1;
|
|
||||||
|
|
||||||
public string $dbname;
|
public string $dbname;
|
||||||
public string $cds;
|
public string $cds;
|
||||||
@@ -226,11 +225,16 @@ class PDO implements StopHeartbeatCheck
|
|||||||
public function check(): bool
|
public function check(): bool
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
if ($this->_last == 0) {
|
||||||
|
$this->_last = time();
|
||||||
|
}
|
||||||
|
if (time() - $this->_last >= 600) {
|
||||||
|
throw new Exception('Idle dis.');
|
||||||
|
}
|
||||||
if (!($this->pdo instanceof \PDO)) {
|
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) {
|
||||||
$this->pdo = null;
|
$this->pdo = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user