Commit 568e7914 authored by project's avatar project

--no commit message

--no commit message
parent dca03c18
......@@ -13,13 +13,20 @@ function memstore(conf){
memstore.prototype.setItem = function(k,v,cb){
var key = this.prefix + ":" + k;
this.mem.set(key,v,cb);
var value = JSON.stringify(v);
this.mem.set(key,value,cb);
}
memstore.prototype.getItem = function(k,cb)
{
var key = this.prefix + ":" + k;
this.mem.get(key,cb);
this.mem.get(key,function(err,v){
var value = null;
if(!err){
value = JSON.parse(v);
}
cb(err,value);
});
}
module.exports = memstore;
......@@ -13,7 +13,7 @@
}
},
"data_transform" : {
"type": "noop"
"type": "gistda-water"
},
"data_out" : {
"type": "storage",
......
......@@ -109,3 +109,14 @@ const crypto = require("crypto");
// evs.sub('storage.sds.#',function(err,msg){
// console.log(msg);
// });
var memstore = ctx.getLib('jobexecutor/lib/memstore');
var ms = new memstore({'job_id':'job01','cat':'global','conn':'redis://:@bigmaster.igridproject.info:6379/1'})
var txt = "kamron\naroonrua"
ms.setItem('test1',{'t':txt});
ms.getItem('test1',function(err,val){
console.log(val.t);
});
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