You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a unix timestamp of an exact date.
Since the timeout is not converted in pylibmc, the semantics of the original protocol apply. That should definitely be part of the API documentation. Maybe it would be a good idea to throw an exception if anyone uses a value from 30 * 24 * 60 * 60 + 1 to, lets says, 1,000,000,000, because people most likely expect something that will not happen.
The text was updated successfully, but these errors were encountered:
Hm, yes that is very confusing. I did know about this behavior, but libmemcached doesn't actually document this behavior either.
IMO this is pretty weird design, I agree that we should not let an int object specify a date. To fix this proper we should accept datetime objects and convert these to UNIX timestamps in the client. This would allow for both usecases to continue working.
The question arises then, what do we do with big ints? I say issue a warning.
I noticed a small but significant omission in the API reference at http://sendapatch.se/projects/pylibmc/reference.html . For the set(key, value[, time=0....) operation it says:
However, in Python, the following happens:
That's because the protocol at http://code.google.com/p/memcached/wiki/NewCommands#Standard_Protocol specifies:
Since the timeout is not converted in pylibmc, the semantics of the original protocol apply. That should definitely be part of the API documentation. Maybe it would be a good idea to throw an exception if anyone uses a value from 30 * 24 * 60 * 60 + 1 to, lets says, 1,000,000,000, because people most likely expect something that will not happen.
The text was updated successfully, but these errors were encountered: