Commit 17ae6ae5 authored by project's avatar project

--no commit message

--no commit message
parent fa35c0b6
......@@ -22,19 +22,19 @@ function amqp_start(cfg)
url : amqp_cfg.url,
name : 'storage_request'
});
server.set_remote_function(function(req,callback){
var n = parseInt(req.t);
console.log('REQUEST ' + req);
setTimeout(function(){
callback(null,{'time':n,'data':req.d});
},n);
})
server.set_remote_function(function(req,callback){
var n = parseInt(req.t);
console.log('REQUEST ' + req);
setTimeout(function(){
callback(null,{'time':n,'data':req.d});
},n);
})
server.start(function(err){
if(!err){
console.log('AMQP START\t\t\t[OK]');
}
});
server.start(function(err){
if(!err){
console.log('AMQP START\t\t\t[OK]');
}
});
}
function http_start(cfg)
......
var async = require('async');
var domain = require('domain');
var schedule = require('node-schedule');
var storage = require('node-persist');
storage.initSync({
......@@ -55,7 +56,6 @@ if(jobcfg.trigger && jobcfg.trigger.type == 'cron' && ONTRIGGER)
}
function run_job(cfg)
{
var jobconfig = cfg;
......@@ -82,13 +82,25 @@ function run_job(cfg)
},
function(request,callback){
var dt_request = {'input_type':request.type,'data':request.data}
perform_dt(context,dt_request,function(err,dt_resp){
if(dt_resp.status == 'success'){
callback(null,dt_resp);
}else {
callback(dt_resp);
}
var dm_t = domain.create();
dm_t.on('error', function(err) {
console.log('plugins error');
callback(err)
});
dm_t.run(function() {
perform_dt(context,dt_request,function(err,dt_resp){
if(dt_resp.status == 'success'){
callback(null,dt_resp);
}else {
callback(dt_resp);
}
});
});
},
function(request,callback){
var do_request = {'input_type':request.type,'data':request.data}
......
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