Skip to content

Commit

Permalink
Fix idle reconnect on normal ping
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdnepro committed Sep 5, 2022
1 parent ad8ae18 commit dfc4755
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/mDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,10 @@ private function ConnectBase()
{
if ($this->connected)
{
if ($this->last_query_time + $this->ping_idle_time < time())
{
if (!$this->instance->ping())
{
// Trying to reconnect
$this->connected = false;
}
} else {
if (($this->last_query_time + $this->ping_idle_time < time()) && !$this->instance->ping()) {
// Trying to reconnect
$this->connected = false;
} else {
return;
}
}
Expand Down

0 comments on commit dfc4755

Please sign in to comment.