Open azhuang321 opened 2 years ago
Details
redis pool use hscan,but the iterator not change
var_dump('hscan----------------------'); $iterator = null; // use \Redis (right) $redis = new \Redis(); $redisBean = \Swoft::getBean('redis'); $redis->pconnect($redisBean->getHost(), $redisBean->getPort()); !empty($redisBean->getPassword()) && $redis->auth($redisBean->getPassword()); $redis->select($redisBean->getDatabase()); $redis->setOption(\Redis::OPT_SCAN,\Redis::SCAN_RETRY); $redis->hScan(config('redisKey.uidFdRelation'), $iterator,'*',10); var_dump($iterator); //use \Redis (right) output //string(27) "hscan----------------------" //int(320) // use pool(wrong) // $this->redisDb->setOption(\Redis::OPT_SCAN,\Redis::SCAN_RETRY); // $this->redisDb->hScan(config('redisKey.uidFdRelation'), $iterator,'*',20) // var_dump($iterator); //use swoft redis pool (wrong) output //string(27) "hscan----------------------" //NULL
Details