We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is it possible to configure timeout on redis connect()?

I've done a bit of searching but only found some references to a deprecated setTimeout() method. Is this supported in Phalcon? Thanks



85.5k

it is a redis function call by the framework

https://github.com/phalcon/cphalcon/pull/14500

with next 3.4.x release warrning should be gone, just use older redis package for a bit

I still didn't find any documentation on how to use it except in the Phalcon source itself. Will this work?

$session = new \Phalcon\Session\Adapter\Redis(array(
    'uniqueId'   => 'uniqueId',
    'host'       => 'localhost',
    'auth'       => 'secret',
    'port'       => 6379,
    'persistent' => false,
    'lifetime'   => 1209600,
    'prefix'     => 'prefix_',
    'timeout' => 3,
));