get teasers: probably faster, hopefully

v1.18.x
psychobunny 10 years ago
parent 29fd03504b
commit b5c7473c95

@ -256,14 +256,14 @@ var db = require('./database'),
},
teasers: function(next) {
var teasers = [];
async.eachSeries(uids, function(fromuid, next) {
async.each(uids, function(fromuid, next) {
Messaging.getMessages({
fromuid: fromuid,
touid: uid,
isNew: false,
count: 1
}, function(err, teaser) {
teasers.push(teaser[0]);
teasers[uids.indexOf(fromuid)] = teaser[0];
next(err);
});
}, function(err) {

Loading…
Cancel
Save