Bug fixes
This commit is contained in:
1 parent
a2e36a36c9
commit
538fe4b0a2
4 files changed
+37
-15
No files matched your search
@@ -60,14 +60,27 @@
|
||||
/*
|
||||
For each dependency declared at the nodeArray, we will initialize a DataSet as part of this initialization process.
|
||||
*/
|
||||
let alreadyCalledBack = false;
|
||||
let addCount = 0;
|
||||
let alreadyCalledBack = false
|
||||
let addCount = 0
|
||||
let skipCount = 0
|
||||
|
||||
/*
|
||||
The current nodeArray that we have includes all the dependencies daclared in the Data Mine / Trading Mine
|
||||
process dependencies, minus the ones without reference parent, meaning that references Data Mines that are
|
||||
not present at the workspace. From all the remaining dependencies there will be others that we need to
|
||||
filter out, and they are the ones which the user does not have a data product anywhere on the network where
|
||||
this task is running, that is storing the data associated to this dependency. The way we use to filter this
|
||||
out is by analizyng the response of the initialization call to the DataSet module. If it did not fail but
|
||||
it was not initialized, then we will assume this happened because the data could not be located and we will
|
||||
assume the user did this on purpose and we will filter out this dependency by not putting it on this new array.
|
||||
*/
|
||||
let newNodeArray = []
|
||||
|
||||
for (let i = 0; i < thisObject.nodeArray.length; i++) {
|
||||
let dataSetModule = DATA_SET.newDataSet(BOT, logger);
|
||||
dataSetModule.initialize(thisObject.nodeArray[i], onInitilized);
|
||||
|
||||
function onInitilized(err) {
|
||||
function onInitilized(err, wasInitialized) {
|
||||
|
||||
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
|
||||
logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> err = " + JSON.stringify(err));
|
||||
@@ -76,17 +89,26 @@
|
||||
callBackFunction(err);
|
||||
return;
|
||||
}
|
||||
addDataSet();
|
||||
|
||||
if (wasInitialized === true) {
|
||||
addCount++;
|
||||
newNodeArray.push(thisObject.nodeArray[i])
|
||||
addDataSet()
|
||||
} else {
|
||||
skipCount++
|
||||
}
|
||||
checkIfWeAreDone()
|
||||
}
|
||||
|
||||
function addDataSet() {
|
||||
addCount++;
|
||||
|
||||
function addDataSet() {
|
||||
thisObject.dataSetsModulesArray.push(dataSetModule);
|
||||
}
|
||||
|
||||
if (addCount === thisObject.nodeArray.length) {
|
||||
function checkIfWeAreDone() {
|
||||
if (addCount + skipCount === thisObject.nodeArray.length) {
|
||||
if (alreadyCalledBack === false) {
|
||||
alreadyCalledBack = true
|
||||
thisObject.nodeArray = newNodeArray
|
||||
callBackFunction(global.DEFAULT_OK_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user