From 328184cec94587ab770463a8c8f2e30abb3c0666 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 25 Nov 2020 23:10:49 +0200 Subject: [PATCH] redis --- swarmlab-app/src/run/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 46e9ee1..d1fd320 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -393,7 +393,7 @@ cors(corsOptions), (req, res, next) => { // socket // *************************************************** -io.origins('*:*') // for latest version +iolog.origins('*:*') // for latest version function onCollection(err, collection) { @@ -409,7 +409,7 @@ function onCollection(err, collection) { var now = new Date(); cursor.on('data', function (data) { console.log('+++++++++ondata<<<<<<<<<<<<<<<<<<<<<<' + data); - io.in('anagnostopoulos@uniwa.gr').emit("logdata", data); + iolog.in('anagnostopoulos@uniwa.gr').emit("logdata", data); var pathfileval = pathmodule.basename(data.tailed_path); var arrfile = pathfileval.toString().split("-"); @@ -450,7 +450,7 @@ function onCollection(err, collection) { console.log('datauser ' + JSON.stringify(user)); //io.in(user).emit("logdata", reslog); var user = 'anagnostopoulos@uniwa.gr' - io.in(user).emit("logdata", reslog); + iolog.in(user).emit("logdata", reslog); itemsProcessed++; })() }else{ @@ -470,7 +470,7 @@ function onCollection(err, collection) { console.log('>>>>>>>>>>2222222222222>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(object)); var user = object.user25user - io.in(user).emit("logdata", reslog); + iolog.in(user).emit("logdata", reslog); itemsProcessed++; }); } @@ -503,7 +503,8 @@ function onCollection(err, collection) { } }); -io.on('connection', s => { +var iolog = io.of('/logs'); +iolog.on('connection', s => { console.error('socket connection'); // ------------------------------