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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPIRE not working? #21

Closed
Dowwie opened this issue Aug 11, 2018 · 1 comment
Closed

EXPIRE not working? #21

Dowwie opened this issue Aug 11, 2018 · 1 comment

Comments

@Dowwie
Copy link

Dowwie commented Aug 11, 2018

resp_array!["EXPIRE", my_key, 90] is failing

Error:
Error("ERR Protocol error: expected '$', got ':'")

UPDATE: the seconds must be expressed as a String or &str. 馃憥

@Dowwie Dowwie closed this as completed Aug 11, 2018
@benashford
Copy link
Owner

At present redis-async doesn't enforce the structure of Redis commands. I have considered doing that, but at the moment it doesn't because otherwise every new Redis release would be incompatible until redis-async catches up and adds new commands/options/etc. This is why resp_array! exists as a macro, to make it easy to construct a Redis command, but it does mean it's up to the calling application to ensure the command is formatted correctly for the version of Redis used.

In this specific case of EXPIRE, I think it's because Redis is expecting the timeout option to be presented as a String. So resp_array!["EXPIRE", my_key, "90"] ought to do the job.

I should add this as documentation on PairedConnect::send (and similar functions elsewhere).

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