|
|
|
@ -590,15 +590,22 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!exists) {
|
|
|
|
|
winston.info('[2014/2/14] Upgraded topics to sorted set - skipped');
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db.getSetMembers('topics:tid', function(err, tids) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!Array.isArray(tids)) {
|
|
|
|
|
winston.info('[2014/2/14] Upgraded topics to sorted set - skipped (cant find any tids)');
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db.rename('topics:tid', 'topics:tid:old', function(err) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
@ -643,6 +650,11 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!Array.isArray(uids)) {
|
|
|
|
|
winston.info('[2014/2/14] Add posts to sorted set - skipped (cant find any uids)');
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async.each(uids, function(uid, next) {
|
|
|
|
|
User.getPostIds(uid, 0, -1, function(err, pids) {
|
|
|
|
|
if(err) {
|
|
|
|
|