Skip to content

Commit 2cfc587

Browse files
committed
fix reconnect bug
1 parent dec3970 commit 2cfc587

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SwooleConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ protected function getConnectRedis(
119119
$poolConfig = PoolManager::getPool($this->poolKey)->getPoolConfig();
120120
$serialize = $poolConfig->getSerialize();
121121
$redis = new \Swoole\Coroutine\Redis(['timeout' => $poolConfig->getTimeout()]);
122-
$retry = $this->retries;
122+
$retry = $this->getPool()->getPoolConfig()->getMaxRetry();
123+
$retry = $retry > 0 ? $retry : 1;
123124
while ($retry-- > 0) {
124125
$result = $redis->connect($host, $port, $serialize);
125126
if ($result !== false) {

0 commit comments

Comments
 (0)