Fix Redis test
- Check if $redis_port is null
This commit is contained in:
parent
3480891277
commit
31cfac1cfa
1 changed files with 3 additions and 1 deletions
|
@ -37,8 +37,10 @@ class RedisCache extends Cache implements IMemoryCache
|
||||||
$redis_pw = $config->get('system', 'redis_password');
|
$redis_pw = $config->get('system', 'redis_password');
|
||||||
$redis_db = $config->get('system', 'redis_db', 0);
|
$redis_db = $config->get('system', 'redis_db', 0);
|
||||||
|
|
||||||
if (!$this->redis->connect($redis_host, $redis_port)) {
|
if (isset($redis_port) && !$this->redis->connect($redis_host, $redis_port)) {
|
||||||
throw new Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available');
|
throw new Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available');
|
||||||
|
} elseif (!$this->redis->connect($redis_host)) {
|
||||||
|
throw new Exception('Expected Redis server at ' . $redis_host . ' isn\'t available');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($redis_pw) && !$this->redis->auth($redis_pw)) {
|
if (isset($redis_pw) && !$this->redis->auth($redis_pw)) {
|
||||||
|
|
Loading…
Reference in a new issue