Skip to content

Node.js based forum software built for the modern web

Add callback to mongo.removeSearch, fixes infinite schema update

MrWafflee4d8ddcf1b2d
diff --git a/src/database/mongo.js b/src/database/mongo.js
index b8bd6f0a64..7a1b71c36d 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -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) {
if(err) {
winston.error('Error removing search ' + err.message);
}
+ if (typeof callback === 'function') {
+ callback()
+ }
});
}