Skip to content

Commit 4d770fd

Browse files
authored
Bugfix #41302 - Alternative (#41546)
* Bugfix #41302 - Alternative This is an alternative option to PR #41502, and adds a match for 'socket' ("socket error when (reading|writing)") to trigger a reconnection. I am not sure if this is valid in other languages, too. My personal preference would be to remove the entire if and ALWAYS reconnect on any Exception Signed-Off-By: Rob Thomas [email protected] * Fix typo (used vim instead of my usual IDE)
1 parent deb9c46 commit 4d770fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Redis/Connections/PhpRedisConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public function command($method, array $parameters = [])
531531
try {
532532
return parent::command($method, $parameters);
533533
} catch (RedisException $e) {
534-
if (str_contains($e->getMessage(), 'went away')) {
534+
if (str_contains($e->getMessage(), 'went away') || str_contains($e->getMessage(), 'socket')) {
535535
$this->client = $this->connector ? call_user_func($this->connector) : $this->client;
536536
}
537537

0 commit comments

Comments
 (0)