From 681970b4a799e7a9281c45a1e9716b0faee31232 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 25 Nov 2020 01:09:09 +0200 Subject: [PATCH] mongo tail --- swarmlab-app/src/run/app.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index b8a7540..e27be4d 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -14,6 +14,10 @@ const subClient = pubClient.duplicate(); io.adapter(createAdapter({ pubClient, subClient })); +RedisClient.on("connect", function() { + console.log("You are now connected"); +}); + const MongoClient = require('mongodb').MongoClient; //var chokidar = require("chokidar"); @@ -426,7 +430,12 @@ function onCollection(err, collection) { resob1.user25user = resdata.data[i].res25user resob1.res25creator = resdata.data[i].res25creator resob1.res25fileforce = resdata.data[i].res25fileforce - resobarray.push(resob1) + resob1.tailed_path = pathfileval + //resobarray.push(resob1) + RedisClient.hmset(pathfileval,JSON.stringify(resob1)) + RedisClient.hgetall(pathfileval, function(err, object) { + console.log('redis '+object); + }); } resob.data = resobarray //var indexfind = global.pipelines.findIndex(x => x.res25swarmlabname==resdata.data[0].res25swarmlabname);