updates and fixes cron

This commit is contained in:
Martin Donnelly 2016-02-09 15:39:02 +00:00
parent bbe77b567f
commit 09f5519dc9

13
lot.js
View File

@ -383,9 +383,7 @@ function prepareResults() {
function saveData() {
jsonfile.writeFile(file, re, function (err) {
console.error(err);
});
jsonfile.writeFileSync(file, re);
}
function sendEmail() {
@ -428,7 +426,7 @@ function processData(data) {
}
function GO() {
re = [];
resultsObj = {};
jsonfile.readFile(file, function (err, obj) {
@ -445,11 +443,10 @@ function GO() {
console.log(resultsObj);
sendEmail();
saveData();
});
});
}
@ -460,6 +457,8 @@ function GO() {
//sendEmail();
cron.schedule('* 10 15 * * 2,5', function(){
cron.schedule('1 00 18 * * 2,5', function(){
GO();
// console.log('tick');
return -1;
});