Skip to content

Commit 991c8fe

Browse files
committed
Fix ping idle time warning and exception
1 parent eb1c746 commit 991c8fe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/mDB.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,17 @@ private function ConnectBase()
137137
{
138138
if ($this->connected)
139139
{
140-
if (($this->last_query_time + $this->ping_idle_time < time()) && !$this->instance->ping()) {
140+
if (($this->last_query_time + $this->ping_idle_time < time()))
141+
{
142+
try {
143+
$ping = @$this->instance->ping();
144+
if ($ping)
145+
{
146+
return;
147+
}
148+
} catch (\Exception $e)
149+
{
150+
}
141151
// Trying to reconnect
142152
$this->connected = false;
143153
} else {

0 commit comments

Comments
 (0)