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 expire returns a signed long, not uint #11

Open
alex88 opened this issue Aug 26, 2019 · 1 comment
Open

Redis expire returns a signed long, not uint #11

alex88 opened this issue Aug 26, 2019 · 1 comment

Comments

@alex88
Copy link

alex88 commented Aug 26, 2019

From my understanding redis uses msec_t which is a long when returning the value of GetExpire here

https://github.com/antirez/redis/blob/unstable/src/module.c#L1636

the problem is that since this library uses an uint64 it's impossible to do key.GetExpire() == rm.NO_EXPIRE because the first is a uint64 and the second a signed int (in this case also negative) and we have to either do int64(keyTTL) != rm.NO_EXPIRE or keyTTL == ^uint64(0)

Wouldn't be better to have GetExpire return a signed int so we can just compare them directly?

@wenerme
Copy link
Owner

wenerme commented Aug 26, 2019

pr is welcome, otherwise I will look into this later, maybe this weekend.

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