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

Added *scan functions to Redis component. #846

Merged
merged 6 commits into from Nov 7, 2019
Merged

Added *scan functions to Redis component. #846

merged 6 commits into from Nov 7, 2019

Conversation

yl
Copy link
Contributor

@yl yl commented Nov 4, 2019

fix #843

@limingxinleo
Copy link
Member

我看你 Scan 那里还额外处理了。。但我认为这里应该是 Redis 的问题,框架这里就不多做额外处理了。

@yl
Copy link
Contributor Author

yl commented Nov 4, 2019

我看你 Scan 那里还额外处理了。。但我认为这里应该是 Redis 的问题,框架这里就不多做额外处理了。

设置 Redis::OPT_PREFIX 选项后,使用 keysscan 命令返回的 keys 是带前缀的,此时如果用户忽略了前缀,直接遍历 keys 查询结果,在查询时又会添加一层前缀,会导致取不到值。

当然,这不是一个BUG。

@yl
Copy link
Contributor Author

yl commented Nov 4, 2019

如果框架内没有在用户不知情的情况下设置过 Redis::OPT_PREFIX ,还是去掉好一点。

@limingxinleo
Copy link
Member

设置 Redis::OPT_PREFIX 选项后,使用 keysscan 命令返回的 keys 是带前缀的,此时如果用户忽略了前缀,直接遍历 keys 查询结果,在查询时又会添加一层前缀,会导致取不到值。

当然,这不是一个BUG。

但这应该是正常的才对。。。phpredis 就是这么设计的啊。。。

@limingxinleo limingxinleo merged commit 6cb398e into hyperf:master Nov 7, 2019
@yl yl deleted the patch-1 branch November 7, 2019 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 使用 Redis scan 命令出现死循环
3 participants