Commit 5921b520 authored by project's avatar project

--no commit message

--no commit message
parent 817342bc
......@@ -33,5 +33,6 @@ TriggerManager.prototype.reload = function (prm,cb)
}
self.evp.send(topic,msg);
cb(null);
if(typeof cb == 'function'){cb(null);}
}
......@@ -39,11 +39,20 @@ JobRegistry.prototype.setJob = function(jobid,job,cb)
var self = this;
var jobKey = PREFIX + ':' + jobid;
var strjob = JSON.stringify(job);
this.mem.set(jobKey,strjob);
this.mem.set(jobKey,strjob,cb);
if(typeof cb == 'function'){
cb();
}
// if(typeof cb == 'function'){
// cb();
// }
}
JobRegistry.prototype.deleteJob = function(jobid,cb)
{
var self = this;
var jobKey = PREFIX + ':' + jobid;
this.mem.del(jobKey,cb);
}
......
......@@ -19,17 +19,32 @@ var TR = function TriggerRegistry(cfg)
}
}
TR.prototype.setTrigger = function(name,trigger,cb)
TR.prototype.setTrigger = function(id,trigger,cb)
{
var self = this;
var strTrigger = JSON.stringify(trigger);
self.mem.hset(KEYS,name,strTrigger);
self.mem.hset(KEYS,id,strTrigger);
if(typeof cb == 'function'){
cb();
}
}
TR.prototype.deleteTrigger = function (id,cb)
{
var self = this;
self.mem.hdel(KEYS,id);
if(typeof cb == 'function'){
cb();
}
}
TR.prototype.deleteByJobId = function (jobid,cb)
{
}
TR.prototype.setByJob = function(job,cb)
{
var self = this;
......
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