Commit 87eb7830 authored by project's avatar project

--no commit message

--no commit message
parent f6f7ae16
...@@ -64,8 +64,11 @@ JobManager.prototype.setJob = function (prm,cb) ...@@ -64,8 +64,11 @@ JobManager.prototype.setJob = function (prm,cb)
if(JUtils.validate(job)){ if(JUtils.validate(job)){
self.job_registry.setJob(job.job_id,job); self.job_registry.setJob(job.job_id,job);
self.trigger_registry.setByJob(job); if(job.trigger){
cb(null); self.trigger_registry.setByJob(job,cb);
}else{
self.trigger_registry.deleteByJobId(job.job_id,cb);
}
}else{ }else{
cb('Invalid job config'); cb('Invalid job config');
} }
......
...@@ -12,7 +12,7 @@ function validate (jobcfg) ...@@ -12,7 +12,7 @@ function validate (jobcfg)
function validate_trigger (trigger) function validate_trigger (trigger)
{ {
if(!trigger){return false;} if(!trigger){return true;}
if(!trigger.type){return false;} if(!trigger.type){return false;}
return true; return true;
......
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