mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
closed #1453
This commit is contained in:
@@ -64,6 +64,10 @@ module.exports = function(db, module) {
|
||||
}
|
||||
};
|
||||
|
||||
module.increment = function(key, callback) {
|
||||
// ^_^
|
||||
};
|
||||
|
||||
module.rename = function(oldKey, newKey, callback) {
|
||||
// G__G
|
||||
};
|
||||
|
||||
@@ -79,6 +79,10 @@ module.exports = function(db, module) {
|
||||
module.setObject(key, data, callback);
|
||||
};
|
||||
|
||||
module.increment = function(key, callback) {
|
||||
db.collection('objects').update({_key: key}, { $inc: { value: 1 } }, helpers.done(callback));
|
||||
};
|
||||
|
||||
module.rename = function(oldKey, newKey, callback) {
|
||||
db.collection('objects').update({_key: oldKey}, {$set:{_key: newKey}}, helpers.done(callback));
|
||||
};
|
||||
|
||||
@@ -85,6 +85,10 @@ module.exports = function(redisClient, module) {
|
||||
redisClient.set(key, value, callback);
|
||||
};
|
||||
|
||||
module.increment = function(key, callback) {
|
||||
redisClient.incr(key, callback);
|
||||
};
|
||||
|
||||
module.rename = function(oldKey, newKey, callback) {
|
||||
redisClient.rename(oldKey, newKey, callback);
|
||||
};
|
||||
@@ -101,7 +105,7 @@ module.exports = function(redisClient, module) {
|
||||
redisClient.pexpire(key, ms, callback);
|
||||
};
|
||||
|
||||
module.expireAt = function(key, timestamp, callback) {
|
||||
module.pexpireAt = function(key, timestamp, callback) {
|
||||
redisClient.pexpireat(key, timestamp, callback);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user