don't set and read from topic hash in parallel (#6831)

this was causing a test to fail, although very rarely
v1.18.x
Barış Soner Uşaklı 6 years ago committed by GitHub
parent 28f2144933
commit a0f5461860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -250,9 +250,10 @@ module.exports = function (Topics) {
}; };
Topics.updateLastPostTime = function (tid, lastposttime, callback) { Topics.updateLastPostTime = function (tid, lastposttime, callback) {
async.parallel([
function (next) {
async.waterfall([ async.waterfall([
function (next) {
Topics.setTopicField(tid, 'lastposttime', lastposttime, next);
},
function (next) { function (next) {
Topics.getTopicFields(tid, ['cid', 'deleted', 'pinned'], next); Topics.getTopicFields(tid, ['cid', 'deleted', 'pinned'], next);
}, },
@ -270,11 +271,6 @@ module.exports = function (Topics) {
} }
async.series(tasks, next); async.series(tasks, next);
}, },
], next);
},
function (next) {
Topics.setTopicField(tid, 'lastposttime', lastposttime, next);
},
], function (err) { ], function (err) {
callback(err); callback(err);
}); });

Loading…
Cancel
Save