mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
temp debug
This commit is contained in:
@@ -192,30 +192,58 @@ var async = require('async'),
|
|||||||
var uids = mapFilter(topics, 'uid');
|
var uids = mapFilter(topics, 'uid');
|
||||||
var cids = mapFilter(topics, 'cid');
|
var cids = mapFilter(topics, 'cid');
|
||||||
|
|
||||||
|
var total = process.hrtime();
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
users: function(next) {
|
users: function(next) {
|
||||||
user.getMultipleUserFields(uids, ['uid', 'username', 'userslug', 'picture'], next);
|
var st = process.hrtime();
|
||||||
|
user.getMultipleUserFields(uids, ['uid', 'username', 'userslug', 'picture'], function(err, data) {
|
||||||
|
process.profile('users', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
categories: function(next) {
|
categories: function(next) {
|
||||||
categories.getMultipleCategoryFields(cids, ['cid', 'name', 'slug', 'icon', 'bgColor', 'color', 'disabled'], next);
|
var st = process.hrtime();
|
||||||
|
categories.getMultipleCategoryFields(cids, ['cid', 'name', 'slug', 'icon', 'bgColor', 'color', 'disabled'], function(err, data) {
|
||||||
|
process.profile('categories', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hasRead: function(next) {
|
hasRead: function(next) {
|
||||||
Topics.hasReadTopics(tids, uid, next);
|
var st = process.hrtime();
|
||||||
|
Topics.hasReadTopics(tids, uid, function(err, data) {
|
||||||
|
process.profile('hasRead', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
isAdminOrMod: function(next) {
|
isAdminOrMod: function(next) {
|
||||||
privileges.categories.isAdminOrMod(cids, uid, next);
|
var st = process.hrtime();
|
||||||
|
privileges.categories.isAdminOrMod(cids, uid, function(err, data) {
|
||||||
|
process.profile('isAdminOrMod', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
teasers: function(next) {
|
teasers: function(next) {
|
||||||
Topics.getTeasers(tids, uid, next);
|
var st = process.hrtime();
|
||||||
|
Topics.getTeasers(tids, uid, function(err, data) {
|
||||||
|
process.profile('teasers', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
tags: function(next) {
|
tags: function(next) {
|
||||||
Topics.getTopicsTagsObjects(tids, next);
|
var st = process.hrtime();
|
||||||
|
Topics.getTopicsTagsObjects(tids, function(err, data) {
|
||||||
|
process.profile('tags', st);
|
||||||
|
next(err, data);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, function(err, results) {
|
}, function(err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
process.profile('total', total);
|
||||||
|
|
||||||
var users = _.object(uids, results.users);
|
var users = _.object(uids, results.users);
|
||||||
var categories = _.object(cids, results.categories);
|
var categories = _.object(cids, results.categories);
|
||||||
var isAdminOrMod = {};
|
var isAdminOrMod = {};
|
||||||
@@ -246,7 +274,7 @@ var async = require('async'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
plugins.fireHook('filter:topics.get', {topics: topics, uid: uid}, function(err, topicData) {
|
plugins.fireHook('filter:topics.get', {topics: topics, uid: uid}, function(err, topicData) {
|
||||||
callback(err, topicData.topics)
|
callback(err, topicData.topics);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user