mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
fixed conflicts
This commit is contained in:
@@ -237,7 +237,15 @@ Upgrade.upgradeRedis = function(callback) {
|
||||
|
||||
function updateKeyToHash(key, next) {
|
||||
RDB.get(key, function(err, value) {
|
||||
RDB.hset('global', newKeys[key], value, next);
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if(value === null) {
|
||||
RDB.hset('global', newKeys[key], initialValues[key], next);
|
||||
} else {
|
||||
RDB.hset('global', newKeys[key], value, next);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -270,6 +278,19 @@ Upgrade.upgradeRedis = function(callback) {
|
||||
'totalpostcount':'postCount'
|
||||
};
|
||||
|
||||
var initialValues = {
|
||||
'global:next_user_id': 1,
|
||||
'next_topic_id': 0,
|
||||
'next_gid': 1,
|
||||
'notifications:next_nid': 0,
|
||||
'global:next_category_id': 12,
|
||||
'global:next_message_id': 0,
|
||||
'global:next_post_id': 0,
|
||||
'usercount': 1,
|
||||
'totaltopiccount': 0,
|
||||
'totalpostcount': 0
|
||||
};
|
||||
|
||||
async.each(keys, updateKeyToHash, function(err) {
|
||||
if(err) {
|
||||
return next(err);
|
||||
|
||||
Reference in New Issue
Block a user