Skip to content

Commit 650f153

Browse files
committed
bug #45057 [Messenger] Avoid reconnecting active Redis connections.
1 parent ce95b87 commit 650f153

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function __construct(array $configuration, array $connectionCredentials =
117117
*/
118118
private static function initializeRedis(\Redis $redis, string $host, int $port, $auth, int $serializer, int $dbIndex): \Redis
119119
{
120+
if ($redis->isConnected()) {
121+
return $redis;
122+
}
123+
120124
$redis->connect($host, $port);
121125
$redis->setOption(\Redis::OPT_SERIALIZER, $serializer);
122126

0 commit comments

Comments
 (0)