Browse Source

redis

master
zeus 4 years ago
parent
commit
c9a4665ca5
  1. 12
      swarmlab-app/src/run/app.js

12
swarmlab-app/src/run/app.js

@ -405,7 +405,7 @@ cors(corsOptions), (req, res, next) => {
io.origins('*:*') // for latest version io.origins('*:*') // for latest version
async function onCollection(err, collection) { function onCollection(err, collection) {
let options = { tailable: true, let options = { tailable: true,
awaitdata: true, awaitdata: true,
numberOfRetries: -1, numberOfRetries: -1,
@ -423,15 +423,17 @@ async function onCollection(err, collection) {
var pathfile = arrfile[0]; var pathfile = arrfile[0];
var indexupdate = true var indexupdate = true
var resob = {}
//var indexfind1 = global.pipelines.findIndex(x => x.pathlogfile==pathfileval); //var indexfind1 = global.pipelines.findIndex(x => x.pathlogfile==pathfileval);
var tmp1 = await pubClient.hgetall(pathfileval, function(err, object) { (async() => {
pubClient.hgetall(pathfileval, function(err, object) {
if(object){ if(object){
indexupdate = false indexupdate = false
}else{ }else{
console.log('redis '+JSON.stringify(object)); console.log('redis '+JSON.stringify(object));
} }
}); });
var resob = {} })()
if (indexupdate ){ if (indexupdate ){
(async() => { (async() => {
var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto
@ -450,7 +452,7 @@ async function onCollection(err, collection) {
resobarray.push(resob1) resobarray.push(resob1)
var resob1string = JSON.stringify(resob1); var resob1string = JSON.stringify(resob1);
pubClient.hmset(pathfileval,resob1string) pubClient.hmset(pathfileval,resob1string)
var tmp2 = await pubClient.hgetall(pathfileval, function(err, object) { await pubClient.hgetall(pathfileval, function(err, object) {
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(object)); console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(object));
}); });
//} //}

Loading…
Cancel
Save