diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index fb47330..a94d18a 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -405,7 +405,7 @@ cors(corsOptions), (req, res, next) => { io.origins('*:*') // for latest version -async function onCollection(err, collection) { +function onCollection(err, collection) { let options = { tailable: true, awaitdata: true, numberOfRetries: -1, @@ -423,15 +423,17 @@ async function onCollection(err, collection) { var pathfile = arrfile[0]; var indexupdate = true + var resob = {} //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){ indexupdate = false }else{ console.log('redis '+JSON.stringify(object)); } - }); - var resob = {} + }); + })() if (indexupdate ){ (async() => { var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto @@ -450,7 +452,7 @@ async function onCollection(err, collection) { resobarray.push(resob1) var resob1string = JSON.stringify(resob1); 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)); }); //}