Skip to content

Commit

Permalink
Update AbstractRedisConnection.php (swoft-cloud/swoft-component#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhhui committed Jun 27, 2018
1 parent ed06c9f commit 9b54860
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/AbstractRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public function reconnect()
public function check(): bool
{
try {
$this->connection->ping();
if (false === $this->connection->ping()) {
throw new \RuntimeException('Connection lost');
}
$connected = true;
} catch (\Throwable $throwable) {
$connected = false;
Expand Down

0 comments on commit 9b54860

Please sign in to comment.