Commit f77bb361 authored by project's avatar project

--no commit message

--no commit message
parent 99ae056d
module.exports = { module.exports = {
'amqp' : require('./amqp.json') 'amqp' : require('./amqp.json'),
'memstore' : require('./memstore.json')
} }
{
"type" : "redis",
"url" : "redis://:lab1.igridproject.info:6380/1"
}
var amqp = require('amqplib/callback_api'); var amqp = require('amqplib/callback_api');
function RPCServer(config) function RPCServer(config)
{ {
......
var Redis = require('ioredis');
module.exports.create = function(cfg,opt)
{
var conn = new ConnectionContext(cfg,opt);
return conn;
}
function ConnCtx(cfg,opt)
{
this.config = cgf;
}
ConnCtx.prototype.getMemstore = function(opt)
{
if(!this.redis){
this.redis = new Redis(this.config.memstore.url);
}
return this.redis;
}
function ResourceStore(prm)
{
}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"buffalo": "^0.1.3", "buffalo": "^0.1.3",
"dateformat": "^1.0.12", "dateformat": "^1.0.12",
"express": "^4.14.0", "express": "^4.14.0",
"ioredis": "^2.5.0",
"node-persist": "^2.0.7", "node-persist": "^2.0.7",
"node-schedule": "^1.2.0", "node-schedule": "^1.2.0",
"node-uuid": "^1.4.7", "node-uuid": "^1.4.7",
......
...@@ -21,26 +21,3 @@ const crypto = require("crypto"); ...@@ -21,26 +21,3 @@ const crypto = require("crypto");
// const id = crypto.randomBytes(16).toString("hex"); // const id = crypto.randomBytes(16).toString("hex");
// //
// console.log(id); // console.log(id);
var cid = null;
var a=0;
var b=0;
for(var i=0;i<1000000000;i++){
if(i==0){
a= (new Date()).getTime();
}else if(i=1000000000-1){
b=(new Date()).getTime();
var c = b-a;
console.log(c);
}
//cid = uuid.v4()
var aid = crypto.randomBytes(12).toString("hex");
if(aid === cid){
console.log('cfggg');
}
cid=aid;
}
console.log(cid);
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