mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 04:21:17 +01:00
updated upgrade script so that it does not rely on Groups.list, as the method has changed between v0.5.0 and v0.6.0.
Also added setImmediate call so eachLimit doesn't explode
This commit is contained in:
@@ -250,11 +250,24 @@ Upgrade.upgrade = function(callback) {
|
||||
}, next);
|
||||
}
|
||||
|
||||
Groups.list({showSystemGroups: true}, function(err, groups) {
|
||||
async.waterfall([
|
||||
async.apply(db.getSetMembers, 'groups'),
|
||||
function(groups, next) {
|
||||
async.filter(groups, function(group, next) {
|
||||
db.getObjectField('group:' + group, 'hidden', function(err, hidden) {
|
||||
next(!parseInt(hidden, 10));
|
||||
}, next);
|
||||
}, function(groups) {
|
||||
next(null, groups);
|
||||
});
|
||||
}
|
||||
], function(err, groups) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
groups.push('administrators', 'registered-users');
|
||||
|
||||
async.eachLimit(cids, 50, function(cid, next) {
|
||||
upgradePrivileges(cid, groups, next);
|
||||
}, next);
|
||||
@@ -445,7 +458,7 @@ Upgrade.upgrade = function(callback) {
|
||||
if (setting.dailyDigestFreq !== 'off') {
|
||||
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
|
||||
} else {
|
||||
next(false);
|
||||
setImmediate(next);
|
||||
}
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user