From e4d8ddcf1b2d1a75d6a5e570a32e975b6e1fd68a Mon Sep 17 00:00:00 2001 From: MrWaffle Date: Mon, 20 Jan 2014 17:21:45 +0100 Subject: [PATCH] Add callback to mongo.removeSearch, fixes infinite schema update --- src/database/mongo.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() + } }); }