Connection::isActive() returns FALSE when the connection is active. This occurs when using the Connection::useSSL property because "$this->hostname:$this->port" is now different to $this->connectionString because of the tcp:// prefix.
What steps will reproduce the problem?
Yii::$app->redis->ping('hello');
var_dump(Yii::$app->redis->isActive); // returns false, should be true
sleep(60);
In redis-cli, run CLIENT LIST and you will see the connection is still open for 60 seconds.
What's expected?
Yii::$app->redis->isActive should return TRUE when the connection is active.
What do you get instead?
Yii::$app->redis->isActive returns FALSE when the connection is active.
Connection::isActive()
returns FALSE when the connection is active. This occurs when using theConnection::useSSL
property because"$this->hostname:$this->port"
is now different to$this->connectionString
because of thetcp://
prefix.What steps will reproduce the problem?
In
redis-cli
, runCLIENT LIST
and you will see the connection is still open for 60 seconds.What's expected?
Yii::$app->redis->isActive
should return TRUE when the connection is active.What do you get instead?
Yii::$app->redis->isActive
returns FALSE when the connection is active.Solution
This line:
Should be changed to: