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++; }