Months Reports need to specify the datetime at the key - Untested

This commit is contained in:
Luis Fernando Molina committed 2018-03-18 21:39:14 +01:00
1 parent f9c333a85c
commit 296912cdb9
6 files changed
+61 -6

No files matched your search

Binary file not shown.
+7 -1
View File
@@ -118,7 +118,13 @@
loadCount++;
let key = pDependenciesConfig[i].devTeam + "-" + pDependenciesConfig[i].bot + "-" + pDependenciesConfig[i].process + "-" + pDependenciesConfig[i].dataSetVersion;
let key;
if (pDependenciesConfig[i].dataSetSection === "Month") {
key = pDependenciesConfig[i].devTeam + "-" + pDependenciesConfig[i].bot + "-" + pDependenciesConfig[i].process + "-" + pDependenciesConfig[i].dataSetVersion + "-" + pYear + "-" + pMonth;
} else {
key = pDependenciesConfig[i].devTeam + "-" + pDependenciesConfig[i].bot + "-" + pDependenciesConfig[i].process + "-" + pDependenciesConfig[i].dataSetVersion;
}
thisObject.statusReports.set(key, statusReportModule);
+43 -4
View File
@@ -159,20 +159,54 @@
loopControl(nextWaitTime);
return;
}
break;
case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time.
logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Retry Later. Requesting Execution Retry.");
nextWaitTime = 'Retry';
loopControl(nextWaitTime);
return;
}
break;
case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Operation Failed. Aborting the process.");
callBackFunction(err);
return;
}
break;
case global.CUSTOM_OK_RESPONSE.result: {
switch (err.message) {
case "Dependency does not exist.": {
logger.write("[WARN] run -> loop -> startUserBot -> onFinished > Dependency does not exist. This Loop will go to sleep.");
nextWaitTime = 'Sleep';
loopControl(nextWaitTime);
return;
}
case "Dependency not ready.": {
logger.write("[WARN] run -> loop -> startUserBot -> onFinished > Dependency not ready. This Loop will go to sleep.");
nextWaitTime = 'Sleep';
loopControl(nextWaitTime);
return;
}
case "Month before it is needed.": {
logger.write("[WARN] run -> loop -> startUserBot -> onFinished > Month before it is needed. This Loop will be terminated.");
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
case "Month fully processed.": {
logger.write("[WARN] run -> loop -> startUserBot -> onFinished > Month fully processed. This Loop will be terminated.");
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
case "End of the month reached.": {
logger.write("[WARN] run -> loop -> startUserBot -> onFinished > End of the month reached. This Loop will be terminated.");
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
default: {
logger.write("[ERROR] run -> loop -> startUserBot -> onFinished > Unhandled custom response received. -> err.message = " + err.message);
callBackFunction(err);
return;
}
}
}
}
}
}
@@ -202,7 +236,7 @@
switch (nextWaitTime) {
case 'Normal': {
if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.executionWaitTime / 1000) + " seconds."); }
setTimeout(loop, processConfig.executionWaitTime);
setTimeout(loop, processConfig.normalWaitTime);
}
break;
case 'Retry': {
@@ -210,6 +244,11 @@
setTimeout(loop, processConfig.retryWaitTime);
}
break;
case 'Sleep': {
if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.retryWaitTime / 60000) + " minutes."); }
setTimeout(loop, processConfig.sleepWaitTime);
}
break;
}
}
+5
View File
@@ -206,6 +206,11 @@
setTimeout(loop, processConfig.retryWaitTime);
}
break;
case 'Sleep': {
if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.retryWaitTime / 60000) + " minutes."); }
setTimeout(loop, processConfig.sleepWaitTime);
}
break;
}
}
+1 -1
View File
@@ -117,7 +117,7 @@
result: global.CUSTOM_OK_RESPONSE.result,
message: "Status Report was never created."
}
logger.write("[WARN] initialize -> load -> onFileReceived -> customOK = " + err.message);
logger.write("[WARN] initialize -> load -> onFileReceived -> customOK = " + customOK.message);
callBackFunction(customOK);
return;
}
+5
View File
@@ -368,6 +368,11 @@
setTimeout(loop, processConfig.retryWaitTime);
}
break;
case 'Sleep': {
if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.retryWaitTime / 60000) + " minutes."); }
setTimeout(loop, processConfig.sleepWaitTime);
}
break;
}
}