Change reconnect logic
This commit is contained in:
parent
ed39069cc2
commit
fe0dc25921
2 changed files with 2 additions and 2 deletions
|
@ -61,6 +61,8 @@ class PDO extends PDONative
|
||||||
|
|
||||||
public function reconnect()
|
public function reconnect()
|
||||||
{
|
{
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
$this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options);
|
$this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options);
|
||||||
|
|
||||||
// Connection settings
|
// Connection settings
|
||||||
|
|
|
@ -49,8 +49,6 @@ class PDOStatement extends PDOStatementNative
|
||||||
try {
|
try {
|
||||||
$result = $this->PDOStatement->execute($input_parameters);
|
$result = $this->PDOStatement->execute($input_parameters);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
// throw new Exception('My Error: ' .$th->getMessage());
|
|
||||||
sleep(1);
|
|
||||||
$this->pdo->reconnect();
|
$this->pdo->reconnect();
|
||||||
$result = $this->PDOStatement->execute($input_parameters);
|
$result = $this->PDOStatement->execute($input_parameters);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue