RETRY loop BUG when status report is corrupt
This commit is contained in:
1 parent
c34fb5ef68
commit
aa1f74031b
4 files changed
+34
-24
No files matched your search
Binary file not shown.
+17
-20
@@ -63,35 +63,32 @@
|
||||
|
||||
try {
|
||||
|
||||
switch (err.result) {
|
||||
case global.DEFAULT_OK_RESPONSE.result: {
|
||||
statusReportModule.status = err.message;
|
||||
|
||||
switch (err.message) {
|
||||
case global.DEFAULT_OK_RESPONSE.message: {
|
||||
logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> bot = " + pDependenciesConfig[i].bot);
|
||||
logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> process = " + pDependenciesConfig[i].process);
|
||||
|
||||
addReport();
|
||||
return;
|
||||
}
|
||||
case global.CUSTOM_OK_RESPONSE.result: { // We need to see if we can handle this.
|
||||
case "Status Report was never created.": {
|
||||
|
||||
if (err.message === "Status Report was never created.") {
|
||||
logger.write("[WARN] initialize -> onLoad -> err.message = " + err.message);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pDependenciesConfig[i].process);
|
||||
addReport();
|
||||
return;
|
||||
}
|
||||
|
||||
logger.write("[WARN] initialize -> onLoad -> err.message = " + err.message);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pDependenciesConfig[i].process);
|
||||
addReport();
|
||||
return;
|
||||
} else {
|
||||
case "Status Report is corrupt.": {
|
||||
|
||||
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> err.message = " + err.message);
|
||||
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> bot = " + pDependenciesConfig[i].bot);
|
||||
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> process = " + pDependenciesConfig[i].process);
|
||||
|
||||
if (alreadyCalledBack === false) {
|
||||
alreadyCalledBack = true;
|
||||
callBackFunction(err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
logger.write("[WARN] initialize -> onLoad -> err.message = " + err.message);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot);
|
||||
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pDependenciesConfig[i].process);
|
||||
addReport();
|
||||
return;
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
+10
-2
@@ -18,6 +18,7 @@
|
||||
initialize: initialize,
|
||||
load: load,
|
||||
save: save,
|
||||
status: undefined,
|
||||
verifyMarketComplete: verifyMarketComplete
|
||||
};
|
||||
|
||||
@@ -144,8 +145,15 @@
|
||||
is being updated at the moment of the read. The bot can not run without a valid Status Report but we can request the platform to retry later.
|
||||
*/
|
||||
|
||||
logger.write("[ERROR] initialize -> load -> onFileReceived -> Bot cannot execute without a valid Status report. -> Err = " + err.message);
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
logger.write("[ERROR] initialize -> load -> onFileReceived -> Error Parsing the Status report. -> Err = " + err.message);
|
||||
|
||||
let customFail = {
|
||||
result: global.CUSTOM_FAIL_RESPONSE.result,
|
||||
message: "Status Report is corrupt."
|
||||
};
|
||||
logger.write("[WARN] initialize -> load -> onFileReceived -> customFail = " + customFail.message);
|
||||
callBackFunction(customFail);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-2
@@ -22,13 +22,18 @@
|
||||
"process": "Poloniex-Hole-Fixing"
|
||||
},
|
||||
{
|
||||
"enabled": "true",
|
||||
"enabled": "false",
|
||||
"botPath": "../Bots/AAMasters/AABruce-Indicator-Bot",
|
||||
"process": "One-Min-Daily-Candles-Volumes"
|
||||
},
|
||||
{
|
||||
"enabled": "true",
|
||||
"botPath": "../Bots/AAMasters/AACharly-Extraction-Bot",
|
||||
"process": "Poloniex-Hole-Fixing"
|
||||
}
|
||||
],
|
||||
"stopGracefully": "true",
|
||||
"exchangeSimulationMode": "false",
|
||||
"storageConnStringFolder": "Mixed",
|
||||
"storageConnStringFolder": "Production",
|
||||
"maxLogLoops": 10
|
||||
}
|
||||
Reference in new issue
Block a user