Added a small timeout for spidering, just to make sure all of the callbacks are done.

This commit is contained in:
Bram van der Veen 2015-06-24 16:42:09 +02:00
parent 49979e7d2d
commit 1b881ac443
2 changed files with 5 additions and 2 deletions

View file

@ -24,7 +24,8 @@ module.exports = function () {
'Login': ['#', '#96AA48'],
'Magister': ['http://werkman.magister.net', '#0C5489'],
'Mail': ['https://login.microsoftonline.com/', '#C41824']
}
},
'spider_timeout' : 1000
}
fs.writeFileSync(__dirname + '/settings.json', JSON.stringify(settings, null, 2)); //Write it to file as prettyprinted json.

View file

@ -88,7 +88,9 @@ function rip(data) {
collection.insert(database_entry, show_output);
if (studentcategory == list[list.length - 1] && student == list_students.length - 1) {
database.close();
setTimeout(function () {
database.close();
}, config().spider_timeout);
}
}