File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ protected function createObject()
1515 /** @var Config $config */
1616 $ config = $ this ->getConfig ()->getExtraConf ();
1717 if ($ config instanceof ClusterConfig){
18- $ info = new RedisCluster ($ config );
19- $ info ->connect ();
20- return $ info ;
18+ $ item = new RedisCluster ($ config );
19+ $ item ->connect ();
20+ $ item ->__lastPingTime = 0 ;
21+ return $ item ;
2122 }else {
22- $ info = new Redis ($ config );
23- $ info ->connect ();
24- return $ info ;
23+ $ item = new Redis ($ config );
24+ $ item ->connect ();
25+ $ item ->__lastPingTime = 0 ;
26+ return $ item ;
2527 }
2628 }
2729
@@ -48,9 +50,6 @@ public function keepMin(?int $num = null): int
4850 */
4951 protected function itemIntervalCheck ($ item ): bool
5052 {
51- if (!isset ($ item ->__lastPingTime )){
52- $ item ->__lastPingTime = 0 ;
53- }
5453 if (time () - $ item ->__lastPingTime > 10 ){
5554 try {
5655 $ ret = $ item ->ping ();
You can’t perform that action at this time.
0 commit comments