linting for tests to pass

v1.18.x
Julian Lam 8 years ago
parent d75cc60e76
commit a2662f8b69

@ -59,6 +59,10 @@ Upgrade.check = function (callback) {
}, []);
db.getSortedSetRange('schemaLog', 0, -1, function (err, executed) {
if (err) {
return callback(err);
}
var remainder = all.filter(function (name) {
return executed.indexOf(name) === -1;
});

@ -1,10 +1,10 @@
/* jslint node: true */
'use strict';
var db = require('../database');
var async = require('async');
var winston = require('winston');
module.exports = {
name: 'Category recent tids',
@ -29,5 +29,5 @@ module.exports = {
});
}, callback);
});
}
};
},
};

@ -1,10 +1,10 @@
/* jslint node: true */
'use strict';
var db = require('../database');
var async = require('async');
var winston = require('winston');
module.exports = {
name: 'Favourites to Bookmarks',
@ -31,7 +31,7 @@ module.exports = {
},
function (next) {
db.deleteObjectField('post:' + id, 'reputation', next);
}
},
], next);
}, next);
}, {}, next);
@ -48,5 +48,5 @@ module.exports = {
}
async.series([upgradePosts, upgradeUsers], callback);
}
};
},
};

@ -1,4 +1,5 @@
/* jslint node: true */
'use strict';
var db = require('../database');
@ -12,7 +13,6 @@ module.exports = {
var batch = require('../batch');
var posts = require('../posts');
var flags = require('../flags');
var migrated = 0;
batch.processSortedSet('posts:pid', function (ids, next) {
posts.getPostsByPids(ids, 1, function (err, posts) {
@ -23,11 +23,11 @@ module.exports = {
posts = posts.filter(function (post) {
return post.hasOwnProperty('flags');
});
async.each(posts, function (post, next) {
async.parallel({
uids: async.apply(db.getSortedSetRangeWithScores, 'pid:' + post.pid + ':flag:uids', 0, -1),
reasons: async.apply(db.getSortedSetRange, 'pid:' + post.pid + ':flag:uid:reason', 0, -1)
reasons: async.apply(db.getSortedSetRange, 'pid:' + post.pid + ':flag:uid:reason', 0, -1),
}, function (err, data) {
if (err) {
return next(err);
@ -51,7 +51,7 @@ module.exports = {
flags.update(flagObj.flagId, 1, {
state: post['flag:state'],
assignee: post['flag:assignee'],
datetime: datetime
datetime: datetime,
}, next);
} else {
setImmediate(next);
@ -72,7 +72,7 @@ module.exports = {
} else {
setImmediate(next);
}
}
},
], function (err) {
if (err && err.message === '[[error:already-flagged]]') {
// Already flagged, no need to parse, but not an error
@ -85,5 +85,5 @@ module.exports = {
}, next);
});
}, callback);
}
};
},
};

@ -1,10 +1,10 @@
/* jslint node: true */
'use strict';
var db = require('../database');
var async = require('async');
var winston = require('winston');
module.exports = {
name: 'Update global and user language keys',
@ -14,8 +14,6 @@ module.exports = {
var meta = require('../meta');
var batch = require('../batch');
var newLanguage;
var i = 0;
var j = 0;
async.parallel([
function (next) {
meta.configs.get('defaultLang', function (err, defaultLang) {
@ -41,23 +39,21 @@ module.exports = {
async.waterfall([
async.apply(db.getObjectField, 'user:' + uid + ':settings', 'userLang'),
function (language, next) {
++i;
if (!language) {
return setImmediate(next);
}
newLanguage = language.replace('_', '-').replace('@', '-x-');
if (newLanguage !== language) {
++j;
user.setSetting(uid, 'userLang', newLanguage, next);
} else {
setImmediate(next);
}
}
},
], next);
}, next);
}, next);
}
},
], callback);
}
};
},
};

@ -1,4 +1,5 @@
/* jslint node: true */
'use strict';
var db = require('../database');
@ -28,10 +29,10 @@ module.exports = {
async.parallel([
async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids:pinned', Date.now(), topicData.tid),
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids', topicData.tid),
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', topicData.tid)
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', topicData.tid),
], next);
}, next);
});
}, callback);
}
};
},
};

@ -1,4 +1,5 @@
/* jslint node: true */
'use strict';
var db = require('../database');
@ -25,10 +26,10 @@ module.exports = {
winston.verbose('processing pid: ' + postData.pid + ' toPid: ' + postData.toPid);
async.parallel([
async.apply(db.sortedSetAdd, 'pid:' + postData.toPid + ':replies', postData.timestamp, postData.pid),
async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies')
async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies'),
], next);
}, next);
});
}, callback);
}
};
},
};

Loading…
Cancel
Save