@@ -41,13 +41,6 @@ public function brPop($keys, $timeout)
4141 {
4242 $ this ->connection = $ this ->pool ->getConnection ();
4343
44- if ($ timeout === 0 ) {
45- // TODO Need to optimize...
46- $ timeout = 99999999999 ;
47- }
48-
49- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ timeout );
50-
5144 $ data = [];
5245
5346 try {
@@ -61,8 +54,6 @@ public function brPop($keys, $timeout)
6154 }
6255 }
6356
64- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ this ->pool ->getConfig ()['time_out ' ]);
65-
6657 $ this ->pool ->close ($ this ->connection );
6758
6859 return $ data ;
@@ -72,13 +63,6 @@ public function blPop($keys, $timeout)
7263 {
7364 $ this ->connection = $ this ->pool ->getConnection ();
7465
75- if ($ timeout === 0 ) {
76- // TODO Need to optimize...
77- $ timeout = 99999999999 ;
78- }
79-
80- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ timeout );
81-
8266 $ data = [];
8367
8468 try {
@@ -92,8 +76,6 @@ public function blPop($keys, $timeout)
9276 }
9377 }
9478
95- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ this ->pool ->getConfig ()['time_out ' ]);
96-
9779 $ this ->pool ->close ($ this ->connection );
9880
9981 return $ data ;
@@ -123,8 +105,6 @@ public function brpoplpush($srcKey, $dstKey, $timeout)
123105 {
124106 $ this ->connection = $ this ->pool ->getConnection ();
125107
126- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ timeout );
127-
128108 try {
129109 $ start = time ();
130110 $ data = $ this ->connection ->brpoplpush ($ srcKey , $ dstKey , $ timeout );
@@ -136,8 +116,6 @@ public function brpoplpush($srcKey, $dstKey, $timeout)
136116 $ data = false ;
137117 }
138118
139- $ this ->connection ->setOption (\Redis::OPT_READ_TIMEOUT , (string ) $ this ->pool ->getConfig ()['time_out ' ]);
140-
141119 $ this ->pool ->close ($ this ->connection );
142120
143121 return $ data ;
0 commit comments