mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #798
This commit is contained in:
@@ -230,6 +230,14 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.rename = function(oldKey, newKey, callback) {
|
||||||
|
db.collection('objects').update({_key: oldKey}, {$set:{_key: newKey}}, function(err, result) {
|
||||||
|
if(callback) {
|
||||||
|
callback(err, result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
module.expire = function(key, seconds, callback) {
|
module.expire = function(key, seconds, callback) {
|
||||||
module.expireAt(key, Math.round(Date.now() / 1000) + seconds, callback);
|
module.expireAt(key, Math.round(Date.now() / 1000) + seconds, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,6 +206,10 @@
|
|||||||
redisClient.keys(key, callback);
|
redisClient.keys(key, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.rename = function(oldKey, newKey, callback) {
|
||||||
|
redisClient.rename(oldKey, newKey, callback);
|
||||||
|
}
|
||||||
|
|
||||||
module.expire = function(key, seconds, callback) {
|
module.expire = function(key, seconds, callback) {
|
||||||
redisClient.expire(key, seconds, callback);
|
redisClient.expire(key, seconds, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user