From ccef02bf0d83ed63bcb55359b24ee65c0f5ae00a Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Thu, 14 Nov 2024 23:42:09 +0800 Subject: [PATCH] fix: fix the reconnect function. --- system/Database/Postgre/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index 416d6e02f86f..fe47c220a335 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -149,8 +149,8 @@ private function convertDSN() */ public function reconnect() { - if (pg_ping($this->connID) === false) { - $this->connID = false; + if ($this->connID === false || pg_ping($this->connID) === false) { + $this->connect(); } }