From fe0dc25921eae26dfac75d0497baef304ffa830d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 3 Jul 2020 14:35:10 +0300 Subject: [PATCH] Change reconnect logic --- src/Appwrite/Extend/PDO.php | 2 ++ src/Appwrite/Extend/PDOStatement.php | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Extend/PDO.php b/src/Appwrite/Extend/PDO.php index fce9165b4e..732f745977 100644 --- a/src/Appwrite/Extend/PDO.php +++ b/src/Appwrite/Extend/PDO.php @@ -61,6 +61,8 @@ class PDO extends PDONative public function reconnect() { + sleep(3); + $this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options); // Connection settings diff --git a/src/Appwrite/Extend/PDOStatement.php b/src/Appwrite/Extend/PDOStatement.php index 63685d7cc4..d41b028ab0 100644 --- a/src/Appwrite/Extend/PDOStatement.php +++ b/src/Appwrite/Extend/PDOStatement.php @@ -49,8 +49,6 @@ class PDOStatement extends PDOStatementNative try { $result = $this->PDOStatement->execute($input_parameters); } catch (\Throwable $th) { - // throw new Exception('My Error: ' .$th->getMessage()); - sleep(1); $this->pdo->reconnect(); $result = $this->PDOStatement->execute($input_parameters); }