[Cache] fix connecting using socket with phpredis
This commit is contained in:
parent
fac1052038
commit
48e5df87a3
@ -156,7 +156,7 @@ trait RedisTrait
|
|||||||
|
|
||||||
$initializer = function ($redis) use ($connect, $params, $dsn, $auth, $hosts) {
|
$initializer = function ($redis) use ($connect, $params, $dsn, $auth, $hosts) {
|
||||||
try {
|
try {
|
||||||
@$redis->{$connect}($hosts[0]['host'], $hosts[0]['port'], $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
|
@$redis->{$connect}($hosts[0]['host'] ?? $hosts[0]['path'], $hosts[0]['port'] ?? null, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
|
||||||
} catch (\RedisException $e) {
|
} catch (\RedisException $e) {
|
||||||
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn));
|
throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user