3rd-Eden / memcached

A fully featured Memcached client build on top of Node.js. Build with scaling in mind so it will support Memcached clusters and consistent hashing.
MIT License
1.31k stars 276 forks source link

Isn't setting value if lifetime to big and result in callback is true #345

Open bbeygel opened 5 years ago

bbeygel commented 5 years ago

After setting value with a half year lifetime value i got a result of true but when trying to get the same value for the same key, nothing was returned.

const time = 60 * 60 * 24 * 7 * 27; this.client.set(key, JSON.stringify(value), time, (err, res) => { if (err) { reject(err); } else { resolve(res); } }); res returns true.

Exitare commented 5 years ago

Had the same issues. No error while storing item. Pretty annoying.

nmaves commented 5 years ago

I think you both might be running into this issue.

When the expiration time specified is 30 days or more in seconds, Memcache treats the expiration as an absolute date by converting the number of seconds specified to a Unix epoch date. Be careful, because specifying 40 days in seconds will set the expiration to a time in 1970, which will yield unknown results.