1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

Change reconnect logic

This commit is contained in:
Eldad Fux 2020-07-03 14:35:10 +03:00
parent ed39069cc2
commit fe0dc25921
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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);
} }