added pexpire and pexpireAt methods for redis and mongo. Added emoticons for leveldb (as per existing implementation by @psychobunny LOL)

v1.18.x
Julian Lam 11 years ago
parent 4e0ccbf0c6
commit bab140c396

@ -75,4 +75,12 @@ module.exports = function(db, module) {
module.expireAt = function(key, timestamp, callback) { module.expireAt = function(key, timestamp, callback) {
// <__< // <__<
}; };
module.pexpire = function(key, ms, callback) {
// o_o
};
module.pexpireAt = function(key, timestamp, callback) {
// d-_-b
};
}; };

@ -90,4 +90,12 @@ module.exports = function(db, module) {
module.expireAt = function(key, timestamp, callback) { module.expireAt = function(key, timestamp, callback) {
module.setObjectField(key, 'expireAt', new Date(timestamp * 1000), callback); module.setObjectField(key, 'expireAt', new Date(timestamp * 1000), callback);
}; };
module.pexpire = function(key, ms, callback) {
module.expireAt(key, Date.now() + parseInt(ms, 10), callback);
};
module.pexpireAt = function(key, timestamp, callback) {
module.setObjectField(key, 'expireAt', new Date(timestamp), callback);
};
}; };

@ -96,4 +96,12 @@ module.exports = function(redisClient, module) {
module.expireAt = function(key, timestamp, callback) { module.expireAt = function(key, timestamp, callback) {
redisClient.expireat(key, timestamp, callback); redisClient.expireat(key, timestamp, callback);
}; };
module.pexpire = function(key, ms, callback) {
redisClient.pexpire(key, ms, callback);
};
module.expireAt = function(key, timestamp, callback) {
redisClient.pexpireat(key, timestamp, callback);
};
}; };
Loading…
Cancel
Save