Skip to content

Instantly share code, notes, and snippets.

@DTrejo
Created October 22, 2011 05:17
Show Gist options
  • Save DTrejo/1305667 to your computer and use it in GitHub Desktop.
Save DTrejo/1305667 to your computer and use it in GitHub Desktop.
bad ttl, not in seconds :|
var redis = require('redis'),
client = redis.createClient();
client.on("error", function (err) { console.log("Error " + err.stack) });
client.set('hello', 'mjr');
var timestamp = (new Date()).getTime() + 400e3;
client.expireat('hello', timestamp, function(err, set) {
client.ttl('hello', function (err, ttl) {
console.log(ttl - timestamp);
});
client.quit()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment