From 9afa94164e835f94900ff6f1d887b51aaf290771 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 25 Nov 2020 20:31:15 +0200 Subject: [PATCH] redis --- swarmlab-app/src/run/app.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index a88961b..74af09f 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -26,15 +26,6 @@ pubClient.on("connect", function() { const MongoClient = require('mongodb').MongoClient; -//var chokidar = require("chokidar"); -//var logpath = "/var/lab/playground-serverlogs"; -//var watcher = chokidar.watch(logpath, { -// ignored: /[\/\\]\./, -// awaitWriteFinish: true, -// persistent: true -// }); - - var async = require("async"); const { check, validationResult } = require('express-validator'); const urlExistSync = require("url-exist-sync"); @@ -470,7 +461,10 @@ function onCollection(err, collection) { //console.log('data ' + JSON.stringify(reslog)); //var usertmp = global.pipelines.find(x => x.pathlogfile==pathfileval); //var user = usertmp.data[0].user25user; - var user = "anagnostopoulos@uniwa.gr" + await pubClient.get(pathfileval, function(err, object) { + console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(object)); + var user = object.user25user + }); console.log('datauser ' + JSON.stringify(user)); io.in(user).emit("logdata", reslog); itemsProcessed++; @@ -484,7 +478,11 @@ function onCollection(err, collection) { //var usertmp = global.pipelines.find(x => x.pathlogfile==pathfileval); //var user = usertmp.data[0].user25user; ///console.log('datauser ' + JSON.stringify(user)); - var user = "anagnostopoulos@uniwa.gr" + //var user = "anagnostopoulos@uniwa.gr" + await pubClient.get(pathfileval, function(err, object) { + console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(object)); + var user = object.user25user + }); io.in(user).emit("logdata", reslog); itemsProcessed++; }