Skip to content

Redis expire returns a signed long, not uint #11

@alex88

Description

@alex88

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions