fix: log error to prevent headers already sent

retry on uniq index fail
v1.18.x
Barış Soner Uşaklı 6 years ago
parent 7524d3c33b
commit a22a3a9861

@ -3,6 +3,7 @@
var async = require('async');
var nconf = require('nconf');
var winston = require('winston');
var user = require('../user');
var meta = require('../meta');
@ -172,7 +173,7 @@ topicsController.get = function getTopic(req, res, callback) {
if (req.loggedIn) {
topics.markAsRead([tid], req.uid, function (err, markedRead) {
if (err) {
return callback(err);
return winston.error(err);
}
if (markedRead) {
topics.pushUnreadCount(req.uid);

@ -55,6 +55,9 @@ module.exports = function (db, module) {
}
bulk.execute(function (err) {
if (err && err.message.startsWith('E11000 duplicate key error')) {
return process.nextTick(module.setsAdd, keys, value, callback);
}
callback(err);
});
};

Loading…
Cancel
Save