Skip to content

Commit

Permalink
reconnect when redis throws connection lost error (#46989)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitor Teixeira <teixeira@kyos.com>
  • Loading branch information
VitorTS and Vitor Teixeira authored May 8, 2023
1 parent 025c912 commit 40a7d54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Redis/Connections/PhpRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public function command($method, array $parameters = [])
try {
return parent::command($method, $parameters);
} catch (RedisException $e) {
foreach (['went away', 'socket', 'read error on connection'] as $errorMessage) {
foreach (['went away', 'socket', 'read error on connection', 'Connection lost'] as $errorMessage) {
if (str_contains($e->getMessage(), $errorMessage)) {
$this->client = $this->connector ? call_user_func($this->connector) : $this->client;

Expand Down

0 comments on commit 40a7d54

Please sign in to comment.