Commit a029210b authored by project's avatar project

--no commit message

--no commit message
parent 5e93b2a4
...@@ -24,8 +24,9 @@ function perform_function(context,request,response){ ...@@ -24,8 +24,9 @@ function perform_function(context,request,response){
async.whilst(function() { return idx < di_data.data.length;}, function(callback) { async.whilst(function() { return idx < di_data.data.length;}, function(callback) {
let dtype = di_data.data[idx].data_types; let dtype = di_data.data[idx].data_types;
//console.log('[DT] di_data length = ' + di_data.data[idx].value.length);
if(di_data.data[idx].value.length > 0){ if(typeof di_data.data[idx].value.length !== "undefined"){
console.log('data = ' + di_data.data[idx].value[0]);
let json = parser.toJson(di_data.data[idx].value[0], {object: true}); let json = parser.toJson(di_data.data[idx].value[0], {object: true});
agriParser.getParser(json.xhr.IO.Type).getValues(di_data.data[idx].value, function(values) { agriParser.getParser(json.xhr.IO.Type).getValues(di_data.data[idx].value, function(values) {
idx++; idx++;
...@@ -42,14 +43,16 @@ function perform_function(context,request,response){ ...@@ -42,14 +43,16 @@ function perform_function(context,request,response){
else callback(); else callback();
}); });
} }
else callback() else {
response.reject();
}
}, function(err) { }, function(err) {
if( err ) { if( err ) {
console.log(err); console.log(err);
response.error(err); //response.error(err);
} else { } else {
//fs.writeFileSync("./result.json", JSON.stringify(result)); //fs.writeFileSync("./result.json", JSON.stringify(result));
//console.log(JSON.stringify(result)); //console.log(JSON.stringify(result));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment