Skip to content

Commit 539437c

Browse files
committed
Set redis timeout
1 parent ea0201b commit 539437c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Cache.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ class Cache {
3131
*/
3232
public function __construct( $host, $port = 6379 ) {
3333
$this->redis = new Redis();
34-
$this->redis->connect( $host, $port );
34+
$this->redis->connect( $host, $port, 2 );
35+
$this->redis->setOption(
36+
Redis::OPT_READ_TIMEOUT, 2 );
3537
$this->redis->setOption(
3638
Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE );
3739
$u = posix_getpwuid( getmyuid() );

0 commit comments

Comments
 (0)