|
|
@ -105,9 +105,14 @@ module.exports = function(redisClient, module) {
|
|
|
|
|
|
|
|
|
|
|
|
module.rename = function(oldKey, newKey, callback) {
|
|
|
|
module.rename = function(oldKey, newKey, callback) {
|
|
|
|
callback = callback || function() {};
|
|
|
|
callback = callback || function() {};
|
|
|
|
|
|
|
|
redisClient.exist(oldKey, function(err, exists) {
|
|
|
|
|
|
|
|
if (err || !exists) {
|
|
|
|
|
|
|
|
return callback(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
redisClient.rename(oldKey, newKey, function(err, res) {
|
|
|
|
redisClient.rename(oldKey, newKey, function(err, res) {
|
|
|
|
callback(err);
|
|
|
|
callback(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.expire = function(key, seconds, callback) {
|
|
|
|
module.expire = function(key, seconds, callback) {
|
|
|
|