From 48594504edb196be6aa5d24bad2766a01ce5551f Mon Sep 17 00:00:00 2001 From: zeus Date: Mon, 23 Nov 2020 23:06:15 +0200 Subject: [PATCH] global --- swarmlab-app/src/run/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 416abb2..7048c11 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -189,9 +189,10 @@ async function getpipelines(token,pipelinename) { global.online='ob'; global.pipelines=[]; - function sendlog(reslog,index){ + function sendlog(reslog,pathfileval){ //io.in("iot").emit("message", reslog); - console.info(reslog); + var usertmp = global.pipelines.find(x => x.pathlogfile==pathfileval); + console.log('-----------------------' + JSON.stringify(usertmp)); } function onWatcherReady(){ console.info('From here can you check for real changes, the initial scan has been completed.'); @@ -317,7 +318,7 @@ cors(corsOptions), (req, res, next) => { console.log(reslog); var pathfileval = pathmodule.basename(reslog.log.tailed_path); var indexfind = global.pipelines.findIndex(x => x.pathlogfile==pathfileval); - //indexfind === 1 ? sendlog(reslog, indexfind) : console.log("object already exists") + indexfind === 1 ? sendlog(reslog,pathfileval) : console.log("object already exists") console.log("IOT "+JSON.stringify(reslog.log.tailed_path)); console.log("IOTindexfind "+JSON.stringify(indexfind)); console.log("IOTuser "+JSON.stringify(global.pipelines));