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

blpop ResponseError: timeout is not an integer or out of range #1060

Open
shanliu opened this issue Feb 22, 2024 · 5 comments
Open

blpop ResponseError: timeout is not an integer or out of range #1060

shanliu opened this issue Feb 22, 2024 · 5 comments

Comments

@shanliu
Copy link

shanliu commented Feb 22, 2024

Is it compatible with <REDIS 6.0?

cargo.toml:
redis = "~0.24";

@nihohit
Copy link
Contributor

nihohit commented Feb 22, 2024

https://redis.io/commands/blpop/
Starting with Redis version 6.0.0: timeout is interpreted as a double instead of an integer.

If you're using earlier redis, you'll need to pass a value that will be parsed to an integer.

@shanliu
Copy link
Author

shanliu commented Feb 22, 2024

It may be a good idea to obtain the Redis version when you connect, and to parse the operation differently according to different versions

https://redis.io/commands/blpop/ Starting with Redis version 6.0.0: timeout is interpreted as a double instead of an integer.

If you're using earlier redis, you'll need to pass a value that will be parsed to an integer.

I don't think it's a good idea to leave the problem to the user

@nihohit
Copy link
Contributor

nihohit commented Feb 22, 2024 via email

@shanliu
Copy link
Author

shanliu commented Feb 23, 2024

I'm not sure what you mean here, since the choice of type is done at compile time, but PRs are always welcome 🙂

On Thu, 22 Feb 2024, 13:10 shanliu, @.> wrote: It may be a good idea to obtain the Redis version when you connect, and to parse the operation differently according to different versions https://redis.io/commands/blpop/ Starting with Redis version 6.0.0: timeout is interpreted as a double instead of an integer. If you're using earlier redis, you'll need to pass a value that will be parsed to an integer. — Reply to this email directly, view it on GitHub <#1060 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDEBBUZWMSHDR2YMKWAFJ3YU4RSVAVCNFSM6AAAAABDUVISE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGIZDCMJXGA . You are receiving this because you commented.Message ID: @.>

Check in blpop.., if version <6, convert f64 to integer.

@nihohit
Copy link
Contributor

nihohit commented Feb 23, 2024

as I said, PRs are welcome.

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

No branches or pull requests

2 participants