Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis pool use hscan problem #1480

Open
azhuang321 opened this issue May 3, 2022 · 0 comments
Open

redis pool use hscan problem #1480

azhuang321 opened this issue May 3, 2022 · 0 comments
Assignees
Labels
swoft: config swoft: db Issues for swoft db component

Comments

@azhuang321
Copy link

azhuang321 commented May 3, 2022

Q A
Bug report? yes
Feature request? no
Swoft version 2.0.11
Swoole version 4.8.9
PHP version 7.3.31
Runtime environment Ubuntu

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
@github-actions github-actions bot added the swoft: db Issues for swoft db component label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swoft: config swoft: db Issues for swoft db component
Projects
None yet
Development

No branches or pull requests

4 participants