Commit c37e0374 authored by project's avatar project

--no commit message

--no commit message
parent 6d10a3e2
...@@ -63,8 +63,12 @@ function response(status,data,type){ ...@@ -63,8 +63,12 @@ function response(status,data,type){
if(type){ if(type){
resp.type = type; resp.type = type;
this.output_type = type; this.output_type = type;
this.data = data; }else{
this.status = status; resp.type = this.output_type;
} }
this.data = data;
this.status = status;
return resp; return resp;
} }
...@@ -6,6 +6,11 @@ var memstore = require('./lib/memstore'); ...@@ -6,6 +6,11 @@ var memstore = require('./lib/memstore');
var CFG_FILE = "./jobs/testhttp.json"; var CFG_FILE = "./jobs/testhttp.json";
var args = process.argv.slice(2);
if(args.length > 0){
CFG_FILE = "./jobs/" + args[0];
}
var jobcfg = require(CFG_FILE); var jobcfg = require(CFG_FILE);
run_job(jobcfg); run_job(jobcfg);
...@@ -25,15 +30,18 @@ function run_job(cfg) ...@@ -25,15 +30,18 @@ function run_job(cfg)
"transaction" : transaction "transaction" : transaction
} }
console.log('JOB STARTED \n[TRANSACTION ID]\t: ' + transaction.id + '\n');
//process di //process di
perform_di(context,function(err,resp){ perform_di(context,function(err,resp){
console.log('>> ' + resp.data);
}); });
} }
function perform_di(context,cb) function perform_di(context,cb)
{ {
console.log('[RUNNING DI]');
var di_context = context; var di_context = context;
var jobId = di_context.jobconfig.job_id; var jobId = di_context.jobconfig.job_id;
...@@ -49,6 +57,9 @@ function perform_di(context,cb) ...@@ -49,6 +57,9 @@ function perform_di(context,cb)
var di = new DITask(di_context); var di = new DITask(di_context);
di.run(); di.run();
di.on('done',function(response){ di.on('done',function(response){
console.log('[DI_OUTPUT_TYPE]\t: ' + resp.type);
console.log('[DI_STATUS]\t\t: ' + resp.status);
console.log('>> ' + resp.data);
cb(null,response); cb(null,response);
}); });
} }
......
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