Add callback to mongo.removeSearch, fixes infinite schema update

v1.18.x
MrWaffle 11 years ago
parent 5a069f1076
commit e4d8ddcf1b

@ -145,11 +145,14 @@
}); });
} }
module.searchRemove = function(key, id) { module.searchRemove = function(key, id, callback) {
db.collection('search').remove({id:id, key:key}, function(err, result) { db.collection('search').remove({id:id, key:key}, function(err, result) {
if(err) { if(err) {
winston.error('Error removing search ' + err.message); winston.error('Error removing search ' + err.message);
} }
if (typeof callback === 'function') {
callback()
}
}); });
} }

Loading…
Cancel
Save