Skip to content

Commit

Permalink
update redis adapter persistent method
Browse files Browse the repository at this point in the history
 add persistent id for Redis `pconnect()` method.
  • Loading branch information
lanlin committed Aug 27, 2019
1 parent 3d76cda commit 856dd1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phalcon/Storage/Adapter/Redis.zep
Expand Up @@ -123,7 +123,9 @@ class Redis extends AbstractAdapter
port = options["port"],
method = persistent ? "pconnect" : "connect";

let result = connection->{method}(host, port, this->lifetime);
let result = "connect" === method ?
connection->connect(host, port, this->lifetime) :
connection->pconnect(host, port, this->lifetime, "persistentid_" . index);

if !result {
throw new Exception(
Expand Down

0 comments on commit 856dd1c

Please sign in to comment.