StatusDependencies
This commit is contained in:
1 parent
e1e93a9ac2
commit
42e5e9e019
5 files changed
+18
-20
No files matched your search
Binary file not shown.
@@ -40,18 +40,18 @@
|
||||
let year;
|
||||
let month;
|
||||
|
||||
let dependencies;
|
||||
let statusDependencies;
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize(pDependencies, pMonth, pYear, callBackFunction) {
|
||||
function initialize(pStatusDependencies, pMonth, pYear, callBackFunction) {
|
||||
|
||||
try {
|
||||
|
||||
year = pYear;
|
||||
month = pMonth;
|
||||
month = utilities.pad(month, 2); // Adding a left zero when needed.
|
||||
dependencies = pDependencies;
|
||||
statusDependencies = pStatusDependencies;
|
||||
|
||||
logger.fileName = MODULE_NAME + "-" + year + "-" + month;
|
||||
|
||||
@@ -59,8 +59,6 @@
|
||||
if (FULL_LOG === true) { logger.write("[INFO] initialize -> pYear = " + year); }
|
||||
if (FULL_LOG === true) { logger.write("[INFO] initialize -> pMonth = " + month); }
|
||||
|
||||
dependencies = pDependencies;
|
||||
|
||||
commons.initializeStorage(charlyStorage, bruceStorage, onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -145,13 +143,13 @@
|
||||
reportKey = "AAMasters" + "-" + "AACharly" + "-" + "Poloniex-Historic-Trades" + "-" + "dataSet.V1";
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); }
|
||||
|
||||
if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. ");
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
thisReport = dependencies.statusReports.get(reportKey).file;
|
||||
thisReport = statusDependencies.statusReports.get(reportKey).file;
|
||||
|
||||
if (thisReport.lastFile === undefined) {
|
||||
logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey);
|
||||
@@ -204,13 +202,13 @@
|
||||
reportKey = "AAMasters" + "-" + "AACharly" + "-" + "Poloniex-Hole-Fixing" + "-" + "dataSet.V1" + "-" + year + "-" + month;
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); }
|
||||
|
||||
if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. ");
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
thisReport = dependencies.statusReports.get(reportKey).file;
|
||||
thisReport = statusDependencies.statusReports.get(reportKey).file;
|
||||
|
||||
if (thisReport.lastFile === undefined) {
|
||||
logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey);
|
||||
@@ -257,13 +255,13 @@
|
||||
reportKey = "AAMasters" + "-" + "AABruce" + "-" + "One-Min-Daily-Candles-Volumes" + "-" + "dataSet.V1" + "-" + year + "-" + month;
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); }
|
||||
|
||||
if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
logger.write("[ERROR] start -> getContextVariables -> Can not continue because self dependecy Status Report is corrupt. Aborting Process.");
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
thisReport = dependencies.statusReports.get(reportKey).file;
|
||||
thisReport = statusDependencies.statusReports.get(reportKey).file;
|
||||
|
||||
if (thisReport.lastFile === undefined) {
|
||||
logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey);
|
||||
@@ -305,8 +303,8 @@
|
||||
} catch (err) {
|
||||
logger.write("[ERROR] start -> getContextVariables -> err = " + err.message);
|
||||
if (err.message === "Cannot read property 'file' of undefined") {
|
||||
logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its dependencies declarations are correct. ");
|
||||
logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(dependencies.keys));
|
||||
logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its statusDependencies declarations are correct. ");
|
||||
logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(statusDependencies.keys));
|
||||
}
|
||||
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
|
||||
}
|
||||
@@ -1035,7 +1033,7 @@
|
||||
try {
|
||||
|
||||
let key = bot.devTeam + "-" + bot.codeName + "-" + bot.process + "-" + bot.dataSetVersion + "-" + year + "-" + month;
|
||||
let statusReport = dependencies.statusReports.get(key);
|
||||
let statusReport = statusDependencies.statusReports.get(key);
|
||||
|
||||
statusReport.file = {
|
||||
lastFile: {
|
||||
|
||||
Generated
+4
-4
@@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"statusDependencies": {
|
||||
"ajv": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.0.tgz",
|
||||
@@ -57,7 +57,7 @@
|
||||
"xml2js": "0.2.7",
|
||||
"xmlbuilder": "0.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"statusDependencies": {
|
||||
"ajv": {
|
||||
"version": "4.11.8",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
|
||||
@@ -186,7 +186,7 @@
|
||||
"tunnel-agent": "0.6.0",
|
||||
"uuid": "3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"statusDependencies": {
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
||||
@@ -256,7 +256,7 @@
|
||||
"requires": {
|
||||
"boom": "5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"statusDependencies": {
|
||||
"boom": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"author": "Luis-Fernando-Molina",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"statusDependencies": {
|
||||
"azure-storage": "^2.6.0",
|
||||
"node-uuid": "^1.4.8",
|
||||
"nonce": "^1.0.4",
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"retryWaitTime": 10000,
|
||||
"sleepWaitTime": 3600000,
|
||||
"comaWaitTime": 86400000,
|
||||
"dependencies": [
|
||||
"statusDependencies": [
|
||||
{
|
||||
"devTeam": "AAMasters",
|
||||
"bot": "AACharly",
|
||||
|
||||
Reference in new issue
Block a user