Added a small timeout for spidering, just to make sure all of the callbacks are done.
This commit is contained in:
parent
49979e7d2d
commit
1b881ac443
|
@ -24,7 +24,8 @@ module.exports = function () {
|
||||||
'Login': ['#', '#96AA48'],
|
'Login': ['#', '#96AA48'],
|
||||||
'Magister': ['http://werkman.magister.net', '#0C5489'],
|
'Magister': ['http://werkman.magister.net', '#0C5489'],
|
||||||
'Mail': ['https://login.microsoftonline.com/', '#C41824']
|
'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.
|
fs.writeFileSync(__dirname + '/settings.json', JSON.stringify(settings, null, 2)); //Write it to file as prettyprinted json.
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,9 @@ function rip(data) {
|
||||||
collection.insert(database_entry, show_output);
|
collection.insert(database_entry, show_output);
|
||||||
|
|
||||||
if (studentcategory == list[list.length - 1] && student == list_students.length - 1) {
|
if (studentcategory == list[list.length - 1] && student == list_students.length - 1) {
|
||||||
database.close();
|
setTimeout(function () {
|
||||||
|
database.close();
|
||||||
|
}, config().spider_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue